auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private java.lang.String clustersListIntoTokenizedString ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > attachedClustersList = getVdsGroupDao ( ) . getClustersByClusterPolicyId ( getParameters ( ) . getClusterPolicyId ( ) ) ; java.util.List < java.lang.String > clusterNamesList = new java.util.LinkedList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup : attachedClustersList ) clusterNamesList.add ( vdsGroup.getName ( ) ) ; return org.apache.commons.lang.StringUtils.join ( clusterNamesList , ',' ) ; }

Target:
private java.lang.String clustersListIntoTokenizedString ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > attachedClustersList = getClusterDao ( ) . getClustersByClusterPolicyId ( getParameters ( ) . getClusterPolicyId ( ) ) ; java.util.List < java.lang.String > clusterNamesList = new java.util.LinkedList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Cluster cluster : attachedClustersList ) clusterNamesList.add ( cluster.getName ( ) ) ; return org.apache.commons.lang.StringUtils.join ( clusterNamesList , ',' ) ; }
Source:
private static boolean hasAttribute ( int id , java.sql.Connection conn , org.ovirt.engine.api.extensions.ExtMap attribute , boolean user ) throws java.sql.SQLException { return ( new org.ovirt.engine.extension.aaa.jdbc.core.datasource.Sql.Query ( org.ovirt.engine.extension.aaa.jdbc.Formatter.format ( "SELECT value FROM WHERE = and name = {}" , ( user ? "@SCHEMA_NAME@.user_attributes" : "@SCHEMA_NAME@.group_attributes" ) , ( user ? "user_id" : "group_id" ) , id , org.ovirt.engine.extension.aaa.jdbc.Formatter.escapeString ( attribute.get ( org.ovirt.engine.extension.aaa.jdbc.core.Schema.SharedKeys.ATTRIBUTE_NAME , java.lang.String.class ) ) ) ) . asString ( conn , "value" ) ) != null ; }

Target:
private static boolean hasAttribute ( int id , java.sql.Connection conn , org.ovirt.engine.api.extensions.ExtMap attribute , boolean user ) throws java.sql.SQLException { return ( new org.ovirt.engine.extension.aaa.jdbc.core.datasource.Sql.Query ( org.ovirt.engine.extension.aaa.jdbc.Formatter.format ( "SELECT value FROM WHERE = and name = {}" , ( user ? "user_attributes" : "group_attributes" ) , ( user ? "user_id" : "group_id" ) , id , org.ovirt.engine.extension.aaa.jdbc.Formatter.escapeString ( attribute.get ( org.ovirt.engine.extension.aaa.jdbc.core.Schema.SharedKeys.ATTRIBUTE_NAME , java.lang.String.class ) ) ) ) . asString ( conn , "value" ) ) != null ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDAO ( ) . get ( org.ovirt.engine.core.bll.GetVdsHooksByIdQuery.getParameters ( ) . getVdsId ( ) ) ; org.ovirt.engine.core.common.queries.ValueObjectMap result = new org.ovirt.engine.core.common.queries.ValueObjectMap ( ) ; if ( vds != null ) { result = org.ovirt.engine.core.utils.vdshooks.VdsHooksParser.parseHooks ( vds.getHooksStr ( ) ) ; } org.ovirt.engine.core.bll.GetVdsHooksByIdQuery.getQueryReturnValue ( ) . setReturnValue ( result ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( org.ovirt.engine.core.bll.GetVdsHooksByIdQuery.getParameters ( ) . getVdsId ( ) ) ; org.ovirt.engine.core.common.queries.ValueObjectMap result = new org.ovirt.engine.core.common.queries.ValueObjectMap ( ) ; if ( vds != null ) { result = org.ovirt.engine.core.utils.vdshooks.VdsHooksParser.parseHooks ( vds.getHooksStr ( ) ) ; } org.ovirt.engine.core.bll.GetVdsHooksByIdQuery.getQueryReturnValue ( ) . setReturnValue ( result ) ; }
Source:
public void cluster_SelectedItemChanged ( ) { updateDefaultHost ( ) ; updateCustomPropertySheet ( ) ; updateMinAllocatedMemory ( ) ; updateNumOfSockets ( ) ; if ( ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; updateQuotaByCluster ( template.getQuotaId ( ) , template.getQuotaName ( ) ) ; } updateCpuPinningVisibility ( ) ; }

Target:
public void postDataCenterWithClusterSelectedItemChanged ( ) { updateDefaultHost ( ) ; updateCustomPropertySheet ( ) ; updateMinAllocatedMemory ( ) ; updateNumOfSockets ( ) ; if ( ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; updateQuotaByCluster ( template.getQuotaId ( ) , template.getQuotaName ( ) ) ; } updateCpuPinningVisibility ( ) ; updateTemplate ( ) ; initNetworkInterfaces ( networkBehavior , null ) ; }
Source:
public static void getRpmVersionViaPublic ( 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.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static 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 ) ; }
Source:
public static org.ovirt.engine.core.common.action.ActionReturnValue validate ( org.ovirt.engine.core.common.action.ActionType actionType , org.ovirt.engine.core.common.action.ActionParametersBase parameters , org.ovirt.engine.core.bll.context.CommandContext commandContext ) { return org.ovirt.engine.core.bll.CommandsFactory.createCommand ( actionType , parameters , commandContext ) . validateOnly ( ) ; }

Target:
public static org.ovirt.engine.core.common.action.ActionReturnValue validate ( org.ovirt.engine.core.common.action.ActionType actionType , org.ovirt.engine.core.common.action.ActionParametersBase parameters , org.ovirt.engine.core.bll.context.CommandContext commandContext , boolean runAsInternal ) { org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.createCommand ( actionType , parameters , commandContext ) ; if ( runAsInternal ) { command.setInternalExecution ( true ) ; } return command.validateOnly ( ) ; }
Source:
public static void GetExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , java.lang.String path ) { 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.storage_domains > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , org.ovirt.engine.core.common.businessentities.StorageType.NFS , domainType , path ) , aQuery ) ; }

Target:
public static void GetLocalFSPath ( 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.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.RhevhLocalFSPath ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.LUNListReturnForXmlRpc getDeviceList ( int storageType ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getDeviceList ( storageType ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.LUNListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.LUNListReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.LUNListReturnForXmlRpc getDeviceList ( int storageType , java.lang.String [ ] devicesList ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = null ; if ( devicesList != null ) { xmlRpcReturnValue = vdsServer.getDeviceList ( storageType , devicesList ) ; } else { xmlRpcReturnValue = vdsServer.getDeviceList ( storageType ) ; } org.ovirt.engine.core.vdsbroker.vdsbroker.LUNListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.LUNListReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { pathLabel.setText ( constants.storagePopupNfsPathLabel ( ) ) ; pathHintLabel.setText ( constants.storagePopupNfsPathHintLabel ( ) ) ; warningLabel.setText ( constants.storagePopupNfsAdvancedOptionsLabel ( ) ) ; versionLabel.setText ( constants.storagePopupNfsVersionLabel ( ) ) ; retransmissionsLabel.setText ( constants.storagePopupNfsRetransmissionsLabel ( ) ) ; timeoutLabel.setText ( constants.storagePopupNfsTimeoutLabel ( ) ) ; }

Target:
void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { pathLabel.setText ( constants.storagePopupNfsPathLabel ( ) ) ; pathHintLabel.setText ( constants.storagePopupNfsPathHintLabel ( ) ) ; warningLabel.setText ( constants.advancedOptionsLabel ( ) ) ; versionLabel.setText ( constants.storagePopupNfsVersionLabel ( ) ) ; retransmissionsLabel.setText ( constants.storagePopupNfsRetransmissionsLabel ( ) ) ; timeoutLabel.setText ( constants.storagePopupNfsTimeoutLabel ( ) ) ; }
Source:
public org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder addRemovedLabels ( java.lang.String ... removedLabels ) { if ( emptyParameters ( removedLabels ) ) { return this ; } if ( ( parameters.getRemovedLabels ( ) ) == null ) { parameters.setRemovedLabels ( new java.util.HashSet < java.lang.String > ( ) ) ; } parameters.getRemovedLabels ( ) . addAll ( java.util.Arrays.asList ( removedLabels ) ) ; return this ; }

Target:
public org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder addRemovedBonds ( org.ovirt.engine.core.compat.Guid ... ids ) { if ( nullParameters ( ids ) ) { return this ; } if ( ( parameters.getRemovedBonds ( ) ) == null ) { parameters.setRemovedBonds ( new java.util.HashSet < org.ovirt.engine.core.compat.Guid > ( ) ) ; } parameters.getRemovedBonds ( ) . addAll ( java.util.Arrays.asList ( ids ) ) ; return this ; }
Source:
public void onSuccess ( java.lang.Object parenModel , java.lang.Object returnValue ) { deactivate ( ) ; getModel ( ) . getMemoryBalloonDeviceEnabled ( ) . setEntity ( ( ( java.lang.Boolean ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ) ; activate ( ) ; updateVirtioScsi ( vmBase ) ; }

Target:
public void onSuccess ( java.lang.Object parenModel , java.lang.Object returnValue ) { deactivate ( ) ; getModel ( ) . getMemoryBalloonDeviceEnabled ( ) . setEntity ( ( ( java.lang.Boolean ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ) ; activate ( ) ; updateRngDevice ( vmBase ) ; }
Source:
protected void doGet ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response ) throws java.io.IOException , javax.servlet.ServletException { java.io.File file = org.ovirt.engine.core.utils.servlet.ServletUtils.makeFileFromSanePath ( request.getPathInfo ( ) , base ) ; file = checkForIndex ( request , response , file , request.getPathInfo ( ) ) ; org.ovirt.engine.core.utils.servlet.ServletUtils.sendFile ( request , response , file , type ) ; }

Target:
protected void doGet ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response ) throws java.io.IOException , javax.servlet.ServletException { java.io.File file = org.ovirt.engine.core.utils.servlet.ServletUtils.makeFileFromSanePath ( request.getPathInfo ( ) , base ) ; file = checkForIndex ( request , response , file , request.getPathInfo ( ) ) ; org.ovirt.engine.core.utils.servlet.ServletUtils.sendFile ( request , response , file , type , cache ) ; }
Source:
private static void exportResource ( java.lang.String apiVersion , java.lang.String resourceName , java.io.File outputDirectory ) throws java.io.IOException { java.lang.String resourcePath = java.lang.String.format ( "/v%s/%s" , apiVersion , resourceName ) ; java.io.InputStream inputResource = org.ovirt.engine.api.rsdl.RsdlIOManager.class . getResourceAsStream ( resourcePath ) ; java.io.File outputFile = new java.io.File ( outputDirectory , resourceName ) ; java.lang.System.out.printf ( "Copying resource \"%s\" to file \"%s\"\n" , resourcePath , outputFile.getAbsolutePath ( ) ) ; org.apache.commons.io.FileUtils.copyInputStreamToFile ( inputResource , outputFile ) ; }

Target:
private static void exportResource ( java.lang.String apiVersion , java.lang.String resourceName , java.io.File outputDirectory ) throws java.io.IOException { java.lang.String resourcePath = java.lang.String.format ( "/v%s/%s" , apiVersion , resourceName ) ; java.io.InputStream inputResource = org.ovirt.engine.api.rsdl.RsdlIOManager.class . getResourceAsStream ( resourcePath ) ; java.io.File outputFile = new java.io.File ( outputDirectory , resourceName ) ; java.lang.System.out.printf ( "Copying resource \"%s\" to file \"%s\"%n" , resourcePath , outputFile.getAbsolutePath ( ) ) ; org.apache.commons.io.FileUtils.copyInputStreamToFile ( inputResource , outputFile ) ; }
Source:
public void validateFailsWithDuplicateVolumeName ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( getVolume ( 2 , false ) ) ) ; prepareMocks ( cmd ) ; org.mockito.Mockito.doReturn ( getVolume ( 2 , false ) ) . when ( volumeDao ) . getByName ( clusterId , "vol1" ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_NAME_ALREADY_EXISTS ) ; }

Target:
public void validateFailsWithArbiterWithClusterDoesNotArbiterVolume ( ) { setVolume ( getVolume ( 3 , false , GlusterVolumeType.REPLICATE , 3 , true ) ) ; org.mockito.Mockito.doReturn ( getCluster ( true , Version.v4_0 ) ) . when ( clusterDao ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_GLUSTER_ARBITER_VOLUME_NOT_SUPPORTED ) ; }
Source:
public java.util.List getEmulatedMachinesList ( ) { java.util.List resultList = lst ( ) ; resultList.add ( "pc-0.10" ) ; resultList.add ( "pc-0.11" ) ; resultList.add ( "pc-0.12" ) ; resultList.add ( "pc-0.13" ) ; resultList.add ( "pc-0.14" ) ; resultList.add ( "pc-0.15" ) ; resultList.add ( "pc-1.0" ) ; resultList.add ( "pc-1.0" ) ; resultList.add ( "rhel6.4.0" ) ; resultList.add ( "pc" ) ; resultList.add ( "isapc" ) ; return resultList ; }

Target:
public java.util.List getEmulatedMachinesList ( ) { java.util.List resultList = lst ( ) ; resultList.add ( "vdsmfake" ) ; resultList.add ( "pc-0.12" ) ; resultList.add ( "pc-0.13" ) ; resultList.add ( "pc-0.14" ) ; resultList.add ( "pc-0.15" ) ; resultList.add ( "pc-1.0" ) ; resultList.add ( "pc-1.0" ) ; resultList.add ( "rhel6.4.0" ) ; resultList.add ( "pc" ) ; resultList.add ( "isapc" ) ; return resultList ; }
Source:
public static java.lang.String formatQueryReturnValues ( java.util.List < org.ovirt.engine.core.common.queries.VdcQueryReturnValue > values ) { java.lang.StringBuilder msg = new java.lang.StringBuilder ( ) ; for ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue val : values ) { msg.append ( val.getExceptionString ( ) ) ; } return msg.toString ( ) ; }

Target:
public static java.lang.String formatQueryReturnValues ( java.util.List < org.ovirt.engine.core.common.queries.QueryReturnValue > values ) { java.lang.StringBuilder msg = new java.lang.StringBuilder ( ) ; for ( org.ovirt.engine.core.common.queries.QueryReturnValue val : values ) { msg.append ( val.getExceptionString ( ) ) ; } return msg.toString ( ) ; }
Source:
public void removeAll ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > interfaces = java.util.Arrays.asList ( createNewInterface ( ) , createNewInterface ( ) ) ; org.mockito.Mockito.when ( vmNetworkInterfaceDAO.getAllForVm ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( interfaces ) ; vmInterfaceManager.removeAll ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface iface : interfaces ) { verifyRemoveAllDelegatedCorrectly ( iface ) ; } }

Target:
public void removeAll ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > interfaces = java.util.Arrays.asList ( createNewInterface ( ) , createNewInterface ( ) ) ; org.mockito.Mockito.when ( vmNetworkInterfaceDAO.getAllForVm ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( interfaces ) ; vmInterfaceManager.removeAll ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : interfaces ) { verifyRemoveAllDelegatedCorrectly ( iface ) ; } }
Source:
public void testNotValidCustomProerties ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setClusterCompatibilityVersion ( Version.v3_3 ) ; java.util.List < java.lang.String > messages = new java.util.ArrayList < > ( ) ; org.junit.Assert.assertFalse ( runVmValidator.validateVmProperties ( vm , "property=value;" , messages ) ) ; org.junit.Assert.assertFalse ( messages.isEmpty ( ) ) ; }

Target:
public void testNotValidCustomProerties ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setClusterCompatibilityVersion ( Version.v4_0 ) ; java.util.List < java.lang.String > messages = new java.util.ArrayList < > ( ) ; org.junit.Assert.assertFalse ( runVmValidator.validateVmProperties ( vm , "property=value;" , messages ) ) ; org.junit.Assert.assertFalse ( messages.isEmpty ( ) ) ; }
Source:
private void initSpyCommand ( ) { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand ( new org.ovirt.engine.core.common.action.LiveMigrateVmDisksParameters ( new java.util.ArrayList < > ( ) , vmId ) , null ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . validateSpaceRequirements ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . checkImagesStatus ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . setAndValidateDiskProfiles ( ) ; }

Target:
private void initSpyCommand ( ) { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand ( new org.ovirt.engine.core.common.action.LiveMigrateVmDisksParameters ( new java.util.ArrayList < > ( ) , vmId ) , null ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . validateDestDomainsSpaceRequirements ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . setAndValidateDiskProfiles ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . validateCreateAllSnapshotsFromVmCommand ( ) ; }
Source:
public static java.util.Collection < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > findAllInterfaceNetworkNameNotEmpty ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > items ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ret = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i : items ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( i.getNetworkName ( ) ) ) ) { ret.add ( i ) ; } } return ret ; }

Target:
public static java.util.Collection < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > findAllInterfaceNetworkNameNotEmpty ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > items ) { return org.ovirt.engine.ui.uicommonweb.Linq.where ( items , new org.ovirt.engine.ui.uicommonweb.Linq.IPredicate < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) { @ java.lang.Override public boolean match ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i ) { return ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( i.getNetworkName ( ) ) ) ; } } ) ; }
Source:
public static void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { 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.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }

Target:
public static void getGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { 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.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }
Source:
public void NameLengthIsTooLong ( ) { org.mockito.Mockito.when ( host.getName ( ) ) . thenReturn ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( ( ( org.ovirt.engine.core.bll.validator.HostValidatorTest.HOST_NAME_SIZE ) * 2 ) ) ) ; org.junit.Assert.assertThat ( validator.nameLengthIsLegal ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_NAME_LENGTH_IS_TOO_LONG ) ) ; }

Target:
public void NameLengthIsTooLong ( ) { org.mockito.Mockito.when ( host.getName ( ) ) . thenReturn ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( ( ( org.ovirt.engine.core.bll.validator.HostValidatorTest.HOST_NAME_SIZE ) * 2 ) ) ) ; org.junit.Assert.assertThat ( validator.nameLengthIsLegal ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NAME_LENGTH_IS_TOO_LONG ) ) ; }
Source:
public static synchronized java.lang.String [ ] getLinksToExclude ( org.ovirt.engine.api.model.StorageDomain storageDomain ) { return org.ovirt.engine.api.restapi.resource.BackendStorageDomainResource.isIsoDomain ( storageDomain ) ? new java.lang.String [ ] { "templates" , "vms" , "disks" } : org.ovirt.engine.api.restapi.resource.BackendStorageDomainResource.isExportDomain ( storageDomain ) ? new java.lang.String [ ] { "files" } : new java.lang.String [ ] { "templates" , "vms" , "files" } ; }

Target:
public static synchronized java.lang.String [ ] getLinksToExclude ( org.ovirt.engine.api.model.StorageDomain storageDomain ) { return org.ovirt.engine.api.restapi.resource.BackendStorageDomainResource.isIsoDomain ( storageDomain ) ? new java.lang.String [ ] { "templates" , "vms" , "disks" , "storageconnections" , "images" } : org.ovirt.engine.api.restapi.resource.BackendStorageDomainResource.isExportDomain ( storageDomain ) ? new java.lang.String [ ] { "files" , "storageconnections" , "images" } : org.ovirt.engine.api.restapi.resource.BackendStorageDomainResource.isImageDomain ( storageDomain ) ? new java.lang.String [ ] { "templates" , "vms" , "files" , "disks" , "storageconnections" } : new java.lang.String [ ] { "templates" , "vms" , "files" , "images" } ; }
Source:
protected void UpdatePriority ( ) { if ( ( cachedMaxPriority ) == null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetMaxVmPriority ( 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 ) ) ; cachedMaxPriority = ( ( java.lang.Integer ) ( returnValue ) ) ; behavior.PostUpdatePriority ( ) ; } } , getModel ( ) . getHash ( ) ) ) ; } else { PostUpdatePriority ( ) ; } }

Target:
protected void updatePriority ( ) { if ( ( cachedMaxPriority ) == null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getMaxVmPriority ( 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 ) ) ; cachedMaxPriority = ( ( java.lang.Integer ) ( returnValue ) ) ; behavior.postUpdatePriority ( ) ; } } , getModel ( ) . getHash ( ) ) ) ; } else { postUpdatePriority ( ) ; } }
Source:
private java.util.List < org.ovirt.engine.ui.uicommonweb.action.UiAction > runNextActionFlowCommon ( boolean lastSuccess ) { java.util.List < org.ovirt.engine.ui.uicommonweb.action.UiAction > actions = runActionFlow ( ActionType.next ) ; org.ovirt.engine.ui.uicommonweb.action.UiAction.ActionFlowState flowState = actions.get ( 0 ) . getActionFlowState ( ) ; verifyRunActionAndExecuteCallbacksRandomly ( true , flowState , 1 ) ; verifyRunActionAndExecuteCallbacksRandomly ( lastSuccess , flowState , 2 , 1 ) ; return actions ; }

Target:
private java.util.List < org.ovirt.engine.ui.uicommonweb.action.UiAction > runNextActionFlowCommon ( boolean lastSuccess ) { java.util.List < org.ovirt.engine.ui.uicommonweb.action.UiAction > actions = runActionFlow ( UiActionBaseTest.ActionType.next ) ; org.ovirt.engine.ui.uicommonweb.action.UiAction.ActionFlowState flowState = actions.get ( 0 ) . getActionFlowState ( ) ; verifyRunActionAndExecuteCallbacksRandomly ( true , flowState , 1 ) ; verifyRunActionAndExecuteCallbacksRandomly ( lastSuccess , flowState , 2 , 1 ) ; return actions ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult addLabelToNicAndValidate ( java.lang.String label , java.util.List < java.lang.Class < ? > > commandValidationGroups ) { java.util.Set < java.lang.String > labels = iface.getLabels ( ) ; if ( labels == null ) { labels = new java.util.HashSet < > ( ) ; iface.setLabels ( labels ) ; } labels.add ( label ) ; java.util.List < java.lang.String > validationResult = org.ovirt.engine.core.common.utils.ValidationUtils.validateInputs ( commandValidationGroups , iface ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.IMPROPER_INTERFACE_IS_LABELED ) . when ( ( ! ( validationResult.isEmpty ( ) ) ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult addLabelToNicAndValidate ( java.lang.String label , java.util.List < java.lang.Class < ? > > commandValidationGroups ) { iface.getLabels ( ) . add ( label ) ; java.util.List < java.lang.String > validationResult = org.ovirt.engine.core.common.utils.ValidationUtils.validateInputs ( commandValidationGroups , iface ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.IMPROPER_INTERFACE_IS_LABELED ) . when ( ( ! ( validationResult.isEmpty ( ) ) ) ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.VolumeFormat GetDiskVolumeFormat ( org.ovirt.engine.core.common.businessentities.VolumeType volumeType , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { switch ( storageType ) { case NFS : case LOCALFS : case POSIXFS : return org.ovirt.engine.core.common.businessentities.VolumeFormat.RAW ; case ISCSI : case FCP : switch ( volumeType ) { case Sparse : return org.ovirt.engine.core.common.businessentities.VolumeFormat.COW ; case Preallocated : return org.ovirt.engine.core.common.businessentities.VolumeFormat.RAW ; default : return org.ovirt.engine.core.common.businessentities.VolumeFormat.Unassigned ; } default : return org.ovirt.engine.core.common.businessentities.VolumeFormat.Unassigned ; } }

Target:
public static org.ovirt.engine.core.common.businessentities.VolumeFormat GetDiskVolumeFormat ( org.ovirt.engine.core.common.businessentities.VolumeType volumeType , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { switch ( storageType ) { case NFS : case LOCALFS : case POSIXFS : case GLUSTERFS : return org.ovirt.engine.core.common.businessentities.VolumeFormat.RAW ; case ISCSI : case FCP : switch ( volumeType ) { case Sparse : return org.ovirt.engine.core.common.businessentities.VolumeFormat.COW ; case Preallocated : return org.ovirt.engine.core.common.businessentities.VolumeFormat.RAW ; default : return org.ovirt.engine.core.common.businessentities.VolumeFormat.Unassigned ; } default : return org.ovirt.engine.core.common.businessentities.VolumeFormat.Unassigned ; } }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel ) ( target ) ) ; model.defaultSpmPriority = ( ( java.lang.Integer ) ( returnValue ) ) ; if ( ( postponedSpmPriority ) != null ) { updateSpmPriority ( postponedSpmPriority ) ; } spmInitialized = true ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < java.lang.String > pmTypes = ( ( java.util.ArrayList < java.lang.String > ) ( returnValue ) ) ; updatePmTypeList ( pmTypes , getPmType ( ) ) ; updatePmTypeList ( pmTypes , getPmSecondaryType ( ) ) ; }
Source:
public void validPluginType ( ) { org.mockito.Mockito.when ( provider.getAdditionalProperties ( ) ) . thenReturn ( properties ) ; org.mockito.Mockito.when ( properties.getPluginType ( ) ) . thenReturn ( OpenstackNetworkPluginType.OPEN_VSWITCH.name ( ) ) ; org.junit.Assert.assertThat ( validator.validateAddProvider ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void validPluginType ( ) { org.mockito.Mockito.when ( provider.getAdditionalProperties ( ) ) . thenReturn ( properties ) ; org.mockito.Mockito.when ( properties.getPluginType ( ) ) . thenReturn ( OpenstackNetworkPluginType.OPEN_VSWITCH.name ( ) ) ; org.hamcrest.MatcherAssert.assertThat ( validator.validateAddProvider ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public boolean updateConsoleUserWithOptimisticLocking ( org.ovirt.engine.core.common.businessentities.VmDynamic vm ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "vm_guid" , vm.getId ( ) ) . addValue ( "console_user_id" , vm.getConsoleUserId ( ) ) . addValue ( "guest_cur_user_name" , vm.getguest_cur_user_name ( ) ) ; java.util.Map < java.lang.String , java.lang.Object > results = getCallsHandler ( ) . executeModification ( "UpdateConsoleUserWithOptimisticLocking" , parameterSource ) ; return ( ( java.lang.Boolean ) ( results.get ( "updated" ) ) ) ; }

Target:
public boolean updateConsoleUserWithOptimisticLocking ( org.ovirt.engine.core.common.businessentities.VmDynamic vm ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "vm_guid" , vm.getId ( ) ) . addValue ( "console_user_id" , vm.getConsoleUserId ( ) ) . addValue ( "guest_cur_user_name" , vm.getguest_cur_user_name ( ) ) . addValue ( "console_cur_user_name" , vm.getConsole_current_user_name ( ) ) ; java.util.Map < java.lang.String , java.lang.Object > results = getCallsHandler ( ) . executeModification ( "UpdateConsoleUserWithOptimisticLocking" , parameterSource ) ; return ( ( java.lang.Boolean ) ( results.get ( "updated" ) ) ) ; }
Source:
public void getStorageDomainMaxNameLength ( 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.lang.Integer ) ( source ) ) : 1 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getTemplateNicList ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > > aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplateInterfacesByTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void testGetBadGuid ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpQueryExpectations ( new java.lang.String [ ] { "cpu.burnout" , "cpu.meltdown" , "cpu.vapourized" } , false ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetBadGuid ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpQueryExpectations ( new java.lang.String [ ] { "cpu.burnout" , "cpu.meltdown" , "cpu.vapourized" } , false ) ; try { resource.get ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel localModel = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( result.getState ( ) ) ) ; localModel.stopProgress ( ) ; setConfirmWindow ( null ) ; if ( result.getReturnValue ( ) . getSucceeded ( ) ) { showRemoveBricksStatus ( ) ; } }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel localModel = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( result.getState ( ) ) ) ; localModel.stopProgress ( ) ; setWindow ( null ) ; }
Source:
private static double computeInterfaceUsage ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface ) { return java.lang.Math.max ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.truncatePercentage ( iface.getStatistics ( ) . getReceiveRate ( ) ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.truncatePercentage ( iface.getStatistics ( ) . getTransmitRate ( ) ) ) ; }

Target:
private static java.lang.Double computeInterfaceUsage ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , boolean totalStatsReported ) { java.lang.Double receiveRate = iface.getStatistics ( ) . getReceiveRate ( ) ; java.lang.Double transmitRate = iface.getStatistics ( ) . getTransmitRate ( ) ; if ( ! totalStatsReported ) { receiveRate = org.ovirt.engine.core.vdsbroker.NetworkStatisticsBuilder.truncatePercentage ( receiveRate ) ; transmitRate = org.ovirt.engine.core.vdsbroker.NetworkStatisticsBuilder.truncatePercentage ( transmitRate ) ; } if ( receiveRate == null ) { return transmitRate ; } else if ( transmitRate == null ) { return receiveRate ; } else { return java.lang.Math.max ( receiveRate , transmitRate ) ; } }
Source:
public void readData ( java.io.ObjectInputStream dis ) { synchronized ( ovirt_engine_dwh.statisticssync_3_2.StatisticsSync.row44Struct.commonByteArrayLock ) { try { int length = 0 ; this . storage_domain_id = ( ( java.lang.Object ) ( dis.readObject ( ) ) ) ; this . storage_domain_join_id = readString ( dis ) ; this . available_disk_size_gb = readInteger ( dis ) ; this . used_disk_size_gb = readInteger ( dis ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } catch ( java.lang.ClassNotFoundException eCNFE ) { throw new java.lang.RuntimeException ( eCNFE ) ; } } }

Target:
public void readData ( java.io.ObjectInputStream dis ) { synchronized ( ovirt_engine_dwh.statisticssync_3_2.StatisticsSync.row44Struct.commonByteArrayLock_OVIRT_ENGINE_DWH_StatisticsSync ) { try { int length = 0 ; this . storage_domain_id = ( ( java.lang.Object ) ( dis.readObject ( ) ) ) ; this . storage_domain_join_id = readString ( dis ) ; this . available_disk_size_gb = readInteger ( dis ) ; this . used_disk_size_gb = readInteger ( dis ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } catch ( java.lang.ClassNotFoundException eCNFE ) { throw new java.lang.RuntimeException ( eCNFE ) ; } } }
Source:
private void assertCanDoActionMessage ( org.ovirt.engine.core.common.errors.EngineMessage msg ) { org.junit.Assert.assertTrue ( "canDoAction failed for the wrong reason" , command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( msg.name ( ) ) ) ; }

Target:
public void testBlockingHostedEngineEditing ( ) { org.ovirt.engine.core.bll.UpdateVmCommandTest.mcr.mockConfigValue ( ConfigValues.AllowEditingHostedEngine , false ) ; vmStatic.setOrigin ( OriginType.MANAGED_HOSTED_ENGINE ) ; boolean validInput = command.validateInputs ( ) ; org.junit.Assert.assertThat ( validInput , org.hamcrest.core.Is.is ( false ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_EDITING_HOSTED_ENGINE_IS_DISABLED.name ( ) ) ) ; }
Source:
public void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { 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.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }

Target:
public void getClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsGroupsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
private void doTestGetDefaultConstraint ( java.lang.Class < ? > clz , java.lang.String expectedConstraint ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = org.mockito.Mockito.mock ( javax.ws.rs.core.UriInfo.class ) ; javax.ws.rs.core.MultivaluedMap < java.lang.String , java.lang.String > queries = org.mockito.Mockito.mock ( javax.ws.rs.core.MultivaluedMap.class ) ; org.mockito.Mockito.when ( queries.isEmpty ( ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( uriInfo.getQueryParameters ( ) ) . thenReturn ( queries ) ; assertEquals ( expectedConstraint , org.ovirt.engine.api.restapi.util.QueryHelper.getConstraint ( null , uriInfo , "" , clz ) ) ; }

Target:
private void doTestGetDefaultConstraint ( java.lang.Class < ? > clz , java.lang.String expectedConstraint ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = org.mockito.Mockito.mock ( javax.ws.rs.core.UriInfo.class ) ; javax.ws.rs.core.MultivaluedMap < java.lang.String , java.lang.String > queries = org.mockito.Mockito.mock ( javax.ws.rs.core.MultivaluedMap.class ) ; org.mockito.Mockito.when ( queries.isEmpty ( ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( uriInfo.getQueryParameters ( ) ) . thenReturn ( queries ) ; org.junit.Assert.assertEquals ( expectedConstraint , org.ovirt.engine.api.restapi.util.QueryHelper.getConstraint ( null , uriInfo , "" , clz ) ) ; }
Source:
private void initMaximalVmMemSize32OS ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getMaximalVmMemSize32OS ( 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.UnitVmModel vmModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; vmModel.set_MaxMemSize32 ( ( ( java.lang.Integer ) ( returnValue ) ) ) ; } } , getHash ( ) ) ) ; }

Target:
private void updateBootMenu ( ) { if ( ( getSelectedCluster ( ) ) != null ) { org.ovirt.engine.core.compat.Version version = getSelectedCluster ( ) . getcompatibility_version ( ) ; final boolean supported = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.isBootMenuSupported ( version.toString ( ) ) ; if ( ! supported ) { getBootMenuEnabled ( ) . setEntity ( false ) ; getBootMenuEnabled ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . bootMenuNotSupported ( version.toString ( 2 ) ) ) ; } getBootMenuEnabled ( ) . setIsChangable ( supported ) ; } }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVmTemplatesDisks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendTemplateDiskResourceTest.TEMPLATE_ID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetVmTemplatesDisks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendTemplateDiskResourceTest.TEMPLATE_ID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
private void mockExistingIfacesWithBond ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond , java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ifacesToBond ) { java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > existingIfaces = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ( ifacesToBond ) ; existingIfaces.add ( createVdsInterface ( bond.getName ( ) , true , null , null , null ) ) ; org.mockito.Mockito.when ( interfaceDAO.getAllInterfacesForVds ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( existingIfaces ) ; }

Target:
private void mockExistingIfacesWithBond ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond , java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ifacesToBond ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface [ ] ifaces = new org.ovirt.engine.core.common.businessentities.VdsNetworkInterface [ ( ifacesToBond.size ( ) ) + 1 ] ; ifacesToBond.toArray ( ifaces ) ; ifaces [ ( ( ifaces.length ) - 1 ) ] = bond ; mockExistingIfaces ( ifaces ) ; }
Source:
private void validateReplacementsDoNotContainUnexpectedItems ( java.util.Collection < java.lang.String > replacements , java.util.List < java.lang.Object > items ) { for ( java.lang.String replacement : replacements ) { for ( int i = ReplacementUtils.DEFAULT_MAX_NUMBER_OF_PRINTED_ITEMS ; i < ( items.size ( ) ) ; i ++ ) { org.junit.Assert.assertFalse ( replacement.contains ( buildPropertyValue ( i ) ) ) ; } } }

Target:
private void validateReplacementsDoNotContainUnexpectedItems ( java.util.Collection < java.lang.String > replacements , java.util.List < java.lang.Object > items ) { for ( java.lang.String replacement : replacements ) { for ( int i = ReplacementUtils.DEFAULT_MAX_NUMBER_OF_PRINTED_ITEMS ; i < ( items.size ( ) ) ; i ++ ) { org.junit.jupiter.api.Assertions.assertFalse ( replacement.contains ( buildPropertyValue ( i ) ) ) ; } } }
Source:
public void calculateNetworkImplementationDetailsNetworkOutOfSyncWithMtuUnset ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNetworkDevice ( ) ; calculateNetworkImplementationDetailsAndAssertSync ( iface , false , iface.getNetworkName ( ) , ( ! ( iface.isBridged ( ) ) ) , 0 , org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextInt ( ) , createQos ( ) ) ; }

Target:
public void calculateNetworkImplementationDetailsNetworkDefaultMtuAndVmNetworkOutOfSync ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNetworkDevice ( ) ; calculateNetworkImplementationDetailsAndAssertSync ( iface , false , iface.getNetworkName ( ) , ( ! ( iface.isBridged ( ) ) ) , 0 , org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextInt ( ) , createQos ( ) ) ; }