auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void initNetworks ( java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > allClusterNetworks ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.hosts.VfsConfigNetwork > vfsConfigNetworks = new java.util.ArrayList < > ( ) ; java.util.Set < org.ovirt.engine.core.compat.Guid > attachedNetworks = getEntity ( ) . getNetworks ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network network : allClusterNetworks ) { boolean isAttached = attachedNetworks.contains ( network.getId ( ) ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.VfsConfigNetwork vfsConfigNetwork = new org.ovirt.engine.ui.uicommonweb.models.hosts.VfsConfigNetwork ( isAttached , ( isAttached ? getAttachedViaLabel ( network ) : null ) , network ) ; vfsConfigNetworks.add ( vfsConfigNetwork ) ; } networks.setItems ( vfsConfigNetworks ) ; }

Target:
private void initNetworks ( java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > allClusterNetworks ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.hosts.VfsConfigNetwork > vfsConfigNetworks = new java.util.ArrayList < > ( ) ; java.util.Set < org.ovirt.engine.core.compat.Guid > attachedNetworks = getEntity ( ) . getNetworks ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network network : allClusterNetworks ) { boolean isAttached = attachedNetworks.contains ( network.getId ( ) ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.VfsConfigNetwork vfsConfigNetwork = new org.ovirt.engine.ui.uicommonweb.models.hosts.VfsConfigNetwork ( isAttached , labelsModel , network ) ; vfsConfigNetworks.add ( vfsConfigNetwork ) ; } networks.setItems ( vfsConfigNetworks ) ; }
Source:
public int hashCode ( ) { int result = 17 ; result = ( 31 * result ) + ( ( name ) != null ? name.hashCode ( ) : 0 ) ; result = ( 31 * result ) + ( ( value ) != null ? value.hashCode ( ) : 0 ) ; return result ; }

Target:
public int hashCode ( ) { return java.util.Objects.hash ( name , value ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.StorageServerConnections createNFSConnection ( java.lang.String connection , org.ovirt.engine.core.common.businessentities.StorageType type , org.ovirt.engine.core.common.businessentities.NfsVersion version , int timeout , int retrans ) { org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections connectionDetails = populateBasicConnectionDetails ( id , connection , type ) ; connectionDetails.setNfsVersion ( version ) ; connectionDetails.setNfsTimeo ( ( ( short ) ( timeout ) ) ) ; connectionDetails.setNfsRetrans ( ( ( short ) ( retrans ) ) ) ; return connectionDetails ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageServerConnections createNFSConnection ( java.lang.String connection , org.ovirt.engine.core.common.businessentities.StorageType type , org.ovirt.engine.core.common.businessentities.NfsVersion version , int timeout , int retrans ) { org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections connectionDetails = populateBasicConnectionDetails ( id , connection , type ) ; connectionDetails.setNfsVersion ( version ) ; connectionDetails.setNfsTimeo ( ( ( short ) ( timeout ) ) ) ; connectionDetails.setNfsRetrans ( ( ( short ) ( retrans ) ) ) ; return connectionDetails ; }
Source:
public static void getClusterNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { if ( ( aQuery.converterCallback ) == null ) { 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.network.Network > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }

Target:
public static void getDomainList ( 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 ( ) . runQuery ( VdcQueryType.GetDomainList , tempVar , aQuery ) ; }
Source:
private java.lang.String getMemoryVolumeForNewActiveSnapshot ( ) { return getParameters ( ) . isImportAsNewEntity ( ) ? org.apache.commons.lang.StringUtils.EMPTY : getMemoryVolumeFromActiveSnapshotInExportDomain ( ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.Snapshot addActiveSnapshot ( org.ovirt.engine.core.compat.Guid snapshotId ) { org.ovirt.engine.core.common.businessentities.Snapshot activeSnapshot = getActiveSnapshot ( ) ; java.lang.String memoryVolume = ( ( activeSnapshot != null ) && ( ! ( getParameters ( ) . isImportAsNewEntity ( ) ) ) ) ? activeSnapshot.getMemoryVolume ( ) : org.apache.commons.lang.StringUtils.EMPTY ; return snapshotsManager.addActiveSnapshot ( snapshotId , getVm ( ) , memoryVolume , org.ovirt.engine.core.bll.ImportVmCommand.getCompensationContext ( ) ) ; }
Source:
protected void initializeVds ( boolean newHost ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.RemoveVds , new org.ovirt.engine.core.common.vdscommands.RemoveVdsVDSCommandParameters ( org.ovirt.engine.core.bll.VdsCommand.getVdsId ( ) , newHost ) ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.AddVds , new org.ovirt.engine.core.common.vdscommands.AddVdsVDSCommandParameters ( org.ovirt.engine.core.bll.VdsCommand.getVdsId ( ) ) ) ; }

Target:
protected void initializeVds ( boolean newHost ) { runVdsCommand ( VDSCommandType.RemoveVds , new org.ovirt.engine.core.common.vdscommands.RemoveVdsVDSCommandParameters ( org.ovirt.engine.core.bll.VdsCommand.getVdsId ( ) , newHost ) ) ; runVdsCommand ( VDSCommandType.AddVds , new org.ovirt.engine.core.common.vdscommands.AddVdsVDSCommandParameters ( org.ovirt.engine.core.bll.VdsCommand.getVdsId ( ) ) ) ; }
Source:
private void testManagementNetworkUnset ( boolean managementBefore , boolean managementAfter , org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > expectedResult ) { org.mockito.Mockito.when ( oldNetworkCluster.isManagement ( ) ) . thenReturn ( managementBefore ) ; org.mockito.Mockito.when ( networkCluster.isManagement ( ) ) . thenReturn ( managementAfter ) ; org.junit.Assert.assertThat ( validator.managementNetworkUnset ( ) , expectedResult ) ; }

Target:
private void testManagementNetworkUnset ( boolean managementBefore , boolean managementAfter , org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > expectedResult ) { oldNetworkCluster.setManagement ( managementBefore ) ; networkCluster.setManagement ( managementAfter ) ; org.junit.Assert.assertThat ( validator.managementNetworkUnset ( ) , expectedResult ) ; }
Source:
private void compose ( java.lang.StringBuilder builder , java.lang.String key , java.lang.String value ) { final char DELIMITER = ',' ; builder.append ( key ) . append ( '=' ) . append ( value ) . append ( DELIMITER ) ; }

Target:
private void compose ( java.lang.StringBuilder builder , java.lang.String key , java.lang.String value ) { final char DELIMITER = ',' ; final char NAME_VALUE_SEPARATOR = '=' ; if ( ( builder.length ( ) ) > 0 ) { builder.append ( DELIMITER ) ; } builder.append ( key ) . append ( NAME_VALUE_SEPARATOR ) . append ( value ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getVdsStaticDao ( ) ) ; dynamicDao = prepareDAO ( dbFacade.getVdsDynamicDao ( ) ) ; statisticsDao = prepareDAO ( dbFacade.getVdsStatisticsDao ( ) ) ; existingVds = dao.get ( FixturesTool.VDS_GLUSTER_SERVER2 ) ; newStaticVds = new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; newStaticVds.sethost_name ( "farkle.redhat.com" ) ; newStaticVds.setvds_group_id ( existingVds.getvds_group_id ( ) ) ; newStaticVds.setSSHKeyFingerprint ( "b5:ad:16:19:06:9f:b3:41:69:eb:1c:42:1d:12:b5:31" ) ; newStaticVds.setPmSecondaryOptionsMap ( new org.ovirt.engine.core.common.queries.ValueObjectMap ( ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getVdsStaticDao ( ) ; dynamicDao = dbFacade.getVdsDynamicDao ( ) ; statisticsDao = dbFacade.getVdsStatisticsDao ( ) ; existingVds = dao.get ( FixturesTool.VDS_GLUSTER_SERVER2 ) ; newStaticVds = new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; newStaticVds.setHostName ( "farkle.redhat.com" ) ; newStaticVds.setVdsGroupId ( existingVds.getVdsGroupId ( ) ) ; newStaticVds.setSSHKeyFingerprint ( "b5:ad:16:19:06:9f:b3:41:69:eb:1c:42:1d:12:b5:31" ) ; newStaticVds.setPmSecondaryOptionsMap ( new org.ovirt.engine.core.common.queries.ValueObjectMap ( ) ) ; }
Source:
protected boolean disconnectStorage ( ) { return org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.DisconnectStorageServer , new org.ovirt.engine.core.common.vdscommands.ConnectStorageServerVDSCommandParameters ( org.ovirt.engine.core.bll.storage.DisconnectStorageServerConnectionCommand.getParameters ( ) . getVdsId ( ) , org.ovirt.engine.core.bll.storage.DisconnectStorageServerConnectionCommand.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.storage.DisconnectStorageServerConnectionCommand.getParameters ( ) . getStorageServerConnection ( ) . getstorage_type ( ) , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageServerConnections > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.StorageServerConnections [ ] { org.ovirt.engine.core.bll.storage.DisconnectStorageServerConnectionCommand.getConnection ( ) } ) ) ) ) . getSucceeded ( ) ; }

Target:
protected boolean disconnectStorage ( ) { return org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.DisconnectStorageServer , new org.ovirt.engine.core.common.vdscommands.StorageServerConnectionManagementVDSParameters ( org.ovirt.engine.core.bll.storage.DisconnectStorageServerConnectionCommand.getParameters ( ) . getVdsId ( ) , org.ovirt.engine.core.bll.storage.DisconnectStorageServerConnectionCommand.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.storage.DisconnectStorageServerConnectionCommand.getParameters ( ) . getStorageServerConnection ( ) . getstorage_type ( ) , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageServerConnections > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.StorageServerConnections [ ] { org.ovirt.engine.core.bll.storage.DisconnectStorageServerConnectionCommand.getConnection ( ) } ) ) ) ) . getSucceeded ( ) ; }
Source:
public static void getVmTemplatesWithPermittedAction ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.TemplateConverter ( ) ; 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.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesWithPermittedAction , getEntitiesWithPermittedActionParameters , aQuery ) ; }

Target:
public void getDataCenterMaxNameLength ( 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 ) ) . intValue ( ) : 1 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StoragePoolNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession getSession ( java.lang.String masterVolumeName , java.util.Map < java.lang.String , java.lang.Object > innerMap ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession geoRepSession = new org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession ( ) ; java.lang.String sessionKey = ( ( java.lang.String ) ( innerMap.get ( org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc.SESSION_KEY ) ) ) ; java.lang.String [ ] sessSplit = sessionKey.split ( "([://]+)" ) ; java.lang.String slaveNode = sessSplit [ 2 ] ; if ( slaveNode.contains ( "@" ) ) { java.lang.String [ ] hostComponents = slaveNode.split ( "@" ) ; slaveNode = hostComponents [ ( ( hostComponents.length ) - 1 ) ] ; geoRepSession.setUserName ( hostComponents [ 0 ] ) ; } java.lang.String slaveVolume = ( ( java.lang.String ) ( innerMap.get ( org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc.REMOTE_VOL_NAME ) ) ) ; geoRepSession.setSlaveHostName ( slaveNode ) ; geoRepSession.setSlaveVolumeName ( slaveVolume ) ; geoRepSession.setSessionKey ( sessionKey ) ; geoRepSession.setMasterVolumeName ( masterVolumeName ) ; return geoRepSession ; }

Target:
protected org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession getSession ( java.lang.String masterVolumeName , java.util.Map < java.lang.String , java.lang.Object > innerMap ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession geoRepSession = new org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession ( ) ; java.lang.String sessionKey = ( ( java.lang.String ) ( innerMap.get ( org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatus.SESSION_KEY ) ) ) ; java.lang.String [ ] sessSplit = sessionKey.split ( "([://]+)" ) ; java.lang.String slaveNode = sessSplit [ 2 ] ; if ( slaveNode.contains ( "@" ) ) { java.lang.String [ ] hostComponents = slaveNode.split ( "@" ) ; slaveNode = hostComponents [ ( ( hostComponents.length ) - 1 ) ] ; geoRepSession.setUserName ( hostComponents [ 0 ] ) ; } java.lang.String slaveVolume = ( ( java.lang.String ) ( innerMap.get ( org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatus.REMOTE_VOL_NAME ) ) ) ; geoRepSession.setSlaveHostName ( slaveNode ) ; geoRepSession.setSlaveVolumeName ( slaveVolume ) ; geoRepSession.setSessionKey ( sessionKey ) ; geoRepSession.setMasterVolumeName ( masterVolumeName ) ; return geoRepSession ; }
Source:
protected void executeQueryCommand ( ) { java.lang.String directoryName = org.ovirt.engine.core.bll.GetDirectoryUserByIdQuery.getParameters ( ) . getDomain ( ) ; org.ovirt.engine.core.common.utils.ExternalId id = org.ovirt.engine.core.bll.GetDirectoryUserByIdQuery.getParameters ( ) . getId ( ) ; org.ovirt.engine.core.authentication.Directory directory = org.ovirt.engine.core.authentication.DirectoryManager.getInstance ( ) . getDirectory ( directoryName ) ; org.ovirt.engine.core.authentication.DirectoryUser user = directory.findUser ( id ) ; org.ovirt.engine.core.bll.GetDirectoryUserByIdQuery.getQueryReturnValue ( ) . setReturnValue ( user ) ; }

Target:
protected void executeQueryCommand ( ) { java.lang.String directoryName = org.ovirt.engine.core.bll.GetDirectoryUserByIdQuery.getParameters ( ) . getDomain ( ) ; org.ovirt.engine.core.common.utils.ExternalId id = org.ovirt.engine.core.bll.GetDirectoryUserByIdQuery.getParameters ( ) . getId ( ) ; org.ovirt.engine.core.authentication.Directory directory = org.ovirt.engine.core.authentication.DirectoryManager.getInstance ( ) . getDirectory ( directoryName ) ; if ( directory == null ) { org.ovirt.engine.core.bll.GetDirectoryUserByIdQuery.getQueryReturnValue ( ) . setSucceeded ( false ) ; } else { org.ovirt.engine.core.authentication.DirectoryUser user = directory.findUser ( id ) ; org.ovirt.engine.core.bll.GetDirectoryUserByIdQuery.getQueryReturnValue ( ) . setReturnValue ( user ) ; } }
Source:
public void testAddSetAndUploadIconFailure ( ) { final org.ovirt.engine.api.model.Template restModel = getRestModel ( 0 ) ; restModel.setLargeIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIconWithData ( ) ) ; restModel.setSmallIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIcon ( GUIDS [ 2 ] ) ) ; try { collection.add ( restModel ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BAD_REQUEST ) ; } }

Target:
public void testAddSetAndUploadIconFailure ( ) { final org.ovirt.engine.api.model.Template restModel = getRestModel ( 0 ) ; restModel.setLargeIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIconWithData ( ) ) ; restModel.setSmallIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIcon ( GUIDS [ 2 ] ) ) ; try { collection.add ( restModel ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BAD_REQUEST ) ; } }
Source:
protected void runningFailed ( ) { try { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RemoveAsyncRunningCommand ( org.ovirt.engine.core.bll.RunVmCommandBase.getVmId ( ) ) ; _isRerun = false ; org.ovirt.engine.core.bll.RunVmCommandBase.setSucceeded ( false ) ; org.ovirt.engine.core.bll.RunVmCommandBase.log ( ) ; processVmPoolOnStopVm ( ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.setAsyncJob ( org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) , false ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.endJob ( org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) , false ) ; } finally { org.ovirt.engine.core.bll.RunVmCommandBase.freeLock ( ) ; } }

Target:
protected void runningFailed ( ) { try { decreasePendingVms ( ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RemoveAsyncRunningCommand ( org.ovirt.engine.core.bll.RunVmCommandBase.getVmId ( ) ) ; _isRerun = false ; org.ovirt.engine.core.bll.RunVmCommandBase.setSucceeded ( false ) ; org.ovirt.engine.core.bll.RunVmCommandBase.log ( ) ; processVmPoolOnStopVm ( ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.setAsyncJob ( org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) , false ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.endJob ( org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) , false ) ; } finally { org.ovirt.engine.core.bll.RunVmCommandBase.freeLock ( ) ; } }
Source:
public void updateGlusterHookStatus ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.gluster.GlusterHookStatus status ) { getCallsHandler ( ) . executeModification ( "UpdateGlusterServerHookStatus" , getCustomMapSqlParameterSource ( ) . addValue ( "hook_id" , id ) . addValue ( "host_id" , hostId ) . addValue ( "status" , org.ovirt.engine.core.common.utils.EnumUtils.nameOrNull ( status ) ) ) ; }

Target:
public void updateGlusterServerHookStatus ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid serverId , org.ovirt.engine.core.common.businessentities.gluster.GlusterHookStatus status ) { getCallsHandler ( ) . executeModification ( "UpdateGlusterServerHookStatus" , getCustomMapSqlParameterSource ( ) . addValue ( "hook_id" , id ) . addValue ( "server_id" , serverId ) . addValue ( "hook_status" , org.ovirt.engine.core.common.utils.EnumUtils.nameOrNull ( status ) ) ) ; }
Source:
private void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { destClusterEditor.setLabel ( constants.importVm_destCluster ( ) ) ; destClusterQuotaEditor.setLabel ( constants.importVm_destClusterQuota ( ) ) ; destStorageEditor.setLabel ( constants.defaultStorage ( ) ) ; cpuProfileEditor.setLabel ( constants.cpuProfileLabel ( ) ) ; }

Target:
private void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { destClusterEditor.setLabel ( constants.importVm_destCluster ( ) ) ; destClusterQuotaEditor.setLabel ( constants.importVm_destClusterQuota ( ) ) ; destStorageEditor.setLabel ( constants.storageDomainDisk ( ) ) ; cpuProfileEditor.setLabel ( constants.cpuProfileLabel ( ) ) ; disksAllocationEditor.setLabel ( constants.allocationDisk ( ) ) ; }
Source:
public void testVmsRule ( ) throws java.lang.Exception { org.ovirt.engine.api.model.AffinityGroup model = new org.ovirt.engine.api.model.AffinityGroup ( ) ; model.setEnforcing ( true ) ; model.setPositive ( false ) ; org.ovirt.engine.api.model.AffinityGroup entity = new org.ovirt.engine.api.model.AffinityGroup ( ) ; org.ovirt.engine.api.restapi.types.AffinityGroupMapper.map ( model , entity ) ; assertEquals ( EntityAffinityRule.NEGATIVE , entity.getVmAffinityRule ( ) ) ; assertEquals ( true , entity.isVmEnforcing ( ) ) ; assertEquals ( true , entity.isVmAffinityEnabled ( ) ) ; }

Target:
public void testVmsRule ( ) throws java.lang.Exception { org.ovirt.engine.api.model.AffinityGroup model = new org.ovirt.engine.api.model.AffinityGroup ( ) ; model.setEnforcing ( true ) ; model.setPositive ( false ) ; org.ovirt.engine.api.model.AffinityGroup entity = new org.ovirt.engine.api.model.AffinityGroup ( ) ; org.ovirt.engine.api.restapi.types.AffinityGroupMapper.map ( model , entity ) ; org.junit.Assert.assertEquals ( EntityAffinityRule.NEGATIVE , entity.getVmAffinityRule ( ) ) ; org.junit.Assert.assertEquals ( true , entity.isVmEnforcing ( ) ) ; org.junit.Assert.assertEquals ( true , entity.isVmAffinityEnabled ( ) ) ; }
Source:
public void testAllowsRhel6InRhel7 ( ) { org.ovirt.engine.core.vdsbroker.VirtMonitoringStrategyTest.mcr.mockConfigValue ( ConfigValues.CheckMixedRhelVersions , Version.v3_5 , false ) ; org.ovirt.engine.core.common.businessentities.VDS vds = createBaseVds ( ) ; vdsFromDb.setHostOs ( "RHEL - 7Server - 1.el7" ) ; vds.setHostOs ( "RHEL - 6Server - 6.5.0.1.el6" ) ; virtStrategy.processSoftwareCapabilities ( vds ) ; org.junit.Assert.assertTrue ( vds.getStatus ( ) . equals ( VDSStatus.Up ) ) ; }

Target:
public void testAllowRhel6InRhel7 ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = createBaseVds ( ) ; vdsFromDb.setHostOs ( "RHEL - 7Server - 1.el7" ) ; vds.setHostOs ( "RHEL - 6Server - 6.5.0.1.el6" ) ; vdsGroup.setClusterPolicyId ( ClusterPolicy.UPGRADE_POLICY_GUID ) ; virtStrategy.processSoftwareCapabilities ( vds ) ; org.junit.Assert.assertFalse ( vds.getStatus ( ) . equals ( VDSStatus.NonOperational ) ) ; }
Source:
public void prepateTest ( ) { vds = basicHost ( ) ; vm = basicVm ( ) ; }

Target:
public void prepareTest ( ) { vds = basicHost ( ) ; vm = basicVm ( ) ; org.mockito.Mockito.doReturn ( 65 ) . when ( vmOverheadCalculator ) . getStaticOverheadInMb ( org.mockito.Matchers.any ( ) ) ; org.mockito.Mockito.doReturn ( 0 ) . when ( vmOverheadCalculator ) . getPossibleOverheadInMb ( org.mockito.Matchers.any ( ) ) ; org.mockito.Mockito.when ( vmOverheadCalculator.getTotalRequiredMemoryInMb ( vm ) ) . thenCallRealMethod ( ) ; org.mockito.Mockito.when ( vmOverheadCalculator.getOverheadInMb ( vm ) ) . thenCallRealMethod ( ) ; }
Source:
public static void getStorageDomainList ( 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.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; 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 ) ; }

Target:
public static void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { 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.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { clearVms ( ) ; exportDomain.setEntity ( null ) ; org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = dataCenters.getSelectedItem ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenter.getId ( ) ) , new org.ovirt.engine.ui.frontend.AsyncQuery ( this , createGetStorageDomainsByStoragePoolIdCallback ( dataCenter ) ) ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { clearVms ( ) ; exportDomain.setEntity ( null ) ; loadProviders ( ) ; org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = dataCenters.getSelectedItem ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenter.getId ( ) ) , new org.ovirt.engine.ui.frontend.AsyncQuery ( this , createGetStorageDomainsByStoragePoolIdCallback ( dataCenter ) ) ) ; }
Source:
private org.ovirt.engine.core.compat.Version clusterVersionOrNull ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = model.getSelectedCluster ( ) ; if ( ( vdsGroup == null ) || ( ( vdsGroup.getCompatibilityVersion ( ) ) == null ) ) { return null ; } return vdsGroup.getCompatibilityVersion ( ) ; }

Target:
public void postUpdateNumOfSockets3 ( ) { java.lang.String version = getCompatibilityVersion ( ) . toString ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxNumOfThreadsPerCpu ( new org.ovirt.engine.ui.frontend.AsyncQuery ( getModel ( ) , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase.this ; behavior.maxThreadsPerCore = ( ( java.lang.Integer ) ( returnValue ) ) ; behavior.totalCpuCoresChanged ( ) ; } } ) , version ) ; }
Source:
protected org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters getCreateSnapshotParameters ( ) { org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters params = new org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters ( enclosingCommand.getParameters ( ) . getVmId ( ) , "Auto-generated for Live Storage Migration" ) ; params.setParentCommand ( VdcActionType.LiveMigrateVmDisks ) ; params.setSnapshotType ( SnapshotType.REGULAR ) ; params.setParentParameters ( enclosingCommand.getParameters ( ) ) ; params.setImagesParameters ( enclosingCommand.getParameters ( ) . getImagesParameters ( ) ) ; params.setTaskGroupSuccess ( enclosingCommand.getParameters ( ) . getTaskGroupSuccess ( ) ) ; params.setNeedsLocking ( false ) ; return params ; }

Target:
protected org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters getCreateSnapshotParameters ( ) { org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters params = new org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters ( enclosingCommand.getParameters ( ) . getVmId ( ) , "Auto-generated for Live Storage Migration" ) ; params.setParentCommand ( VdcActionType.LiveMigrateVmDisks ) ; params.setSnapshotType ( SnapshotType.REGULAR ) ; params.setParentParameters ( enclosingCommand.getParameters ( ) ) ; params.setImagesParameters ( enclosingCommand.getParameters ( ) . getImagesParameters ( ) ) ; params.setTaskGroupSuccess ( enclosingCommand.getParameters ( ) . getTaskGroupSuccess ( ) ) ; params.setDiskIdsToIgnoreInChecks ( getMovedDiskIds ( ) ) ; params.setNeedsLocking ( false ) ; return params ; }
Source:
void localize ( org.ovirt.engine.ui.common.CommonApplicationConstants constants , org.ovirt.engine.ui.common.CommonApplicationMessages messages , org.ovirt.engine.ui.common.CommonApplicationTemplates templates ) { message1.setHTML ( listItem ( messages.nextRunConfigurationExists ( ) , templates ) ) ; message2.setHTML ( listItem ( messages.nextRunConfigurationCanBeAppliedImmediately ( ) , templates ) ) ; applyCpuLaterEditor.setLabel ( constants.applyLater ( ) ) ; changedFieldsExpander.setTitleWhenExpended ( constants.changedFieldsList ( ) ) ; changedFieldsExpander.setTitleWhenCollapsed ( constants.changedFieldsList ( ) ) ; }

Target:
void localize ( ) { message1.setHTML ( listItem ( org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmNextRunConfigurationWidget.messages.nextRunConfigurationExists ( ) ) ) ; message2.setHTML ( listItem ( org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmNextRunConfigurationWidget.messages.nextRunConfigurationCanBeAppliedImmediately ( ) ) ) ; applyCpuLaterEditor.setLabel ( org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmNextRunConfigurationWidget.constants.applyLater ( ) ) ; changedFieldsExpander.setTitleWhenExpended ( org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmNextRunConfigurationWidget.constants.changedFieldsList ( ) ) ; changedFieldsExpander.setTitleWhenCollapsed ( org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmNextRunConfigurationWidget.constants.changedFieldsList ( ) ) ; }
Source:
private static void deleteFile ( java.lang.String filePath ) { java.io.File file = new java.io.File ( filePath ) ; if ( file.exists ( ) ) { if ( ! ( file.delete ( ) ) ) { org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomains.log.info ( ( ( "Failed deleting file " + ( file.getAbsolutePath ( ) ) ) + ". Continuing anyway." ) ) ; } } }

Target:
private static void deleteFile ( java.lang.String filePath ) { java.io.File file = new java.io.File ( filePath ) ; if ( file.exists ( ) ) { if ( ! ( file.delete ( ) ) ) { org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomains.log.info ( "Failed deleting file {}. Continuing anyway." , file.getAbsolutePath ( ) ) ; } } }
Source:
public static void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { 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.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }

Target:
public static void getGlusterHooks ( 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.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }
Source:
private org.ovirt.engine.api.model.Network getModel ( int index ) { org.ovirt.engine.api.model.Network model = new org.ovirt.engine.api.model.Network ( ) ; model.setId ( GUIDS [ 0 ] . toString ( ) ) ; model.setName ( NAMES [ index ] ) ; model.setDescription ( DESCRIPTIONS [ index ] ) ; return model ; }

Target:
public void testAddNameSuppliedButNoId ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.Network model = new org.ovirt.engine.api.model.Network ( ) ; model.setName ( "orcus" ) ; model.setDescription ( DESCRIPTIONS [ 0 ] ) ; setUpEntityQueryExpectations ( 1 , null ) ; setUpGetNetworksByDataCenterExpectations ( 1 , null ) ; setUpClusterExpectations ( org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID ) ; setUpActionExpectations ( VdcActionType.AttachNetworkToCluster , org.ovirt.engine.core.common.action.AttachNetworkToClusterParameter.class , new java.lang.String [ ] { "ClusterId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , true , true ) ; collection.add ( model ) ; }
Source:
public void canDoActionSucceeds ( ) { 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 ( getStorageDevice ( "sda" , null ) ) ) ) ) ; prepareMocks ( cmd , VDSStatus.Up ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; }

Target:
public void canDoActionSucceeds ( ) { 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 ( getStorageDevice ( "sda" , null ) ) ) ) ) ; prepareMocks ( cmd , VDSStatus.Up ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; }
Source:
public boolean isMemorySnapshotSupported ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( vm == null ) { return false ; } boolean archMemorySnapshotSupported = isMemorySnapshotSupportedByArchitecture ( vm.getClusterArch ( ) , vm.getVdsGroupCompatibilityVersion ( ) ) ; return ( ( java.lang.Boolean ) ( getConfigValuePreConverted ( ConfigurationValues.MemorySnapshotSupported , vm.getVdsGroupCompatibilityVersion ( ) . toString ( ) ) ) ) && archMemorySnapshotSupported ; }

Target:
public boolean canVmsBePaused ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > items ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : items ) { if ( ! ( isSuspendSupportedByArchitecture ( vm.getClusterArch ( ) , vm.getCompatibilityVersion ( ) ) ) ) { return false ; } } return true ; }
Source:
public void testFilter ( ) throws org.apache.xmlrpc.XmlRpcException { java.util.List < java.lang.String > result = proxy.filter ( new java.lang.String [ ] { org.ovirt.schedulerproxy.SchedulerProxyTest.CLASS_NAME } , org.ovirt.schedulerproxy.SchedulerProxyTest.HOST_ARRAY , org.ovirt.schedulerproxy.SchedulerProxyTest.VM_ID , "" ) ; org.junit.Assert.assertTrue ( ( ( result.size ( ) ) == ( org.ovirt.schedulerproxy.SchedulerProxyTest.HOST_ARRAY.length ) ) ) ; org.junit.Assert.assertTrue ( result.contains ( org.ovirt.schedulerproxy.SchedulerProxyTest.HOST_ID1 ) ) ; org.junit.Assert.assertTrue ( result.contains ( org.ovirt.schedulerproxy.SchedulerProxyTest.HOST_ID2 ) ) ; }

Target:
public void testFilter ( ) throws org.apache.xmlrpc.XmlRpcException { java.util.List < java.lang.String > result = proxy.filter ( new java.lang.String [ ] { org.ovirt.schedulerproxy.SchedulerProxyTest.CLASS_NAME } , org.ovirt.schedulerproxy.SchedulerProxyTest.HOST_ARRAY , org.ovirt.schedulerproxy.SchedulerProxyTest.VM_ID , "" ) . getHosts ( ) ; org.junit.Assert.assertTrue ( ( ( result.size ( ) ) == ( org.ovirt.schedulerproxy.SchedulerProxyTest.HOST_ARRAY.length ) ) ) ; org.junit.Assert.assertTrue ( result.contains ( org.ovirt.schedulerproxy.SchedulerProxyTest.HOST_ID1 ) ) ; org.junit.Assert.assertTrue ( result.contains ( org.ovirt.schedulerproxy.SchedulerProxyTest.HOST_ID2 ) ) ; }
Source:
public void testSetStatusForRequiredNetworkPresentOnHost ( ) { networkCluster.setStatus ( NetworkStatus.OPERATIONAL ) ; testSetStatusForRequiredNetwork ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_NAME ) ; org.mockito.Mockito.verify ( networkClusterDao , org.mockito.Mockito.never ( ) ) . updateStatus ( org.mockito.Matchers.same ( networkCluster ) ) ; org.junit.Assert.assertThat ( networkCluster.getStatus ( ) , org.hamcrest.Matchers.is ( NetworkStatus.OPERATIONAL ) ) ; }

Target:
public void testSetStatusForRequiredNetworkPresentOnHost ( ) { networkCluster.setStatus ( NetworkStatus.OPERATIONAL ) ; testSetStatusForRequiredNetwork ( createNetwork ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_ID1 , org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_NAME1 ) , org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_NAME1 ) ; org.mockito.Mockito.verify ( networkClusterDao , org.mockito.Mockito.never ( ) ) . updateStatus ( org.mockito.Matchers.same ( networkCluster ) ) ; org.junit.Assert.assertThat ( networkCluster.getStatus ( ) , org.hamcrest.Matchers.is ( NetworkStatus.OPERATIONAL ) ) ; }
Source:
public void testValidate ( ) { org.ovirt.engine.core.searchbackend.VdsConditionFieldAutoCompleter comp = new org.ovirt.engine.core.searchbackend.VdsConditionFieldAutoCompleter ( ) ; org.junit.Assert.assertTrue ( "1" , comp.validateFieldValue ( "LOAD" , "1" ) ) ; org.junit.Assert.assertTrue ( "123" , comp.validateFieldValue ( "LOAD" , "123" ) ) ; org.junit.Assert.assertTrue ( "123.456" , comp.validateFieldValue ( "LOAD" , "123.456" ) ) ; org.junit.Assert.assertFalse ( "JarJar" , comp.validateFieldValue ( "LOAD" , "JarJar" ) ) ; }

Target:
public void testValidate ( ) { org.junit.Assert.assertTrue ( "1" , underTest.validateFieldValue ( "LOAD" , "1" ) ) ; org.junit.Assert.assertTrue ( "123" , underTest.validateFieldValue ( "LOAD" , "123" ) ) ; org.junit.Assert.assertTrue ( "123.456" , underTest.validateFieldValue ( "LOAD" , "123.456" ) ) ; org.junit.Assert.assertFalse ( "JarJar" , underTest.validateFieldValue ( "LOAD" , "JarJar" ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.StorageDomain initStorageDomain ( org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; storageDomain.setId ( storageDomainId ) ; storageDomain.setStoragePoolId ( storagePoolId ) ; org.mockito.Mockito.when ( storageDomainDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( storageDomain ) ; org.mockito.Mockito.when ( storageDomainDao.getForStoragePool ( storageDomainId , storagePoolId ) ) . thenReturn ( storageDomain ) ; return storageDomain ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageDomain initStorageDomain ( org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; storageDomain.setId ( storageDomainId ) ; storageDomain.setStoragePoolId ( storagePoolId ) ; org.mockito.Mockito.when ( storageDomainDao.get ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( storageDomain ) ; org.mockito.Mockito.when ( storageDomainDao.getForStoragePool ( storageDomainId , storagePoolId ) ) . thenReturn ( storageDomain ) ; return storageDomain ; }
Source:
static org.ovirt.engine.api.model.Cluster getModel ( int index ) { org.ovirt.engine.api.model.Cluster model = new org.ovirt.engine.api.model.Cluster ( ) ; model.setName ( NAMES [ index ] ) ; model.setDescription ( DESCRIPTIONS [ index ] ) ; model.setDataCenter ( new org.ovirt.engine.api.model.DataCenter ( ) ) ; model.setCpu ( new org.ovirt.engine.api.model.CPU ( ) ) ; model.getCpu ( ) . setId ( "Intel Xeon" ) ; return model ; }

Target:
static org.ovirt.engine.api.model.Cluster getModel ( int index ) { org.ovirt.engine.api.model.Cluster model = new org.ovirt.engine.api.model.Cluster ( ) ; model.setName ( NAMES [ index ] ) ; model.setDescription ( DESCRIPTIONS [ index ] ) ; model.setDataCenter ( new org.ovirt.engine.api.model.DataCenter ( ) ) ; model.setCpu ( new org.ovirt.engine.api.model.CPU ( ) ) ; model.getCpu ( ) . setType ( "Intel Xeon" ) ; return model ; }
Source:
static org.ovirt.engine.api.model.Network setUpEntityExpectations ( org.ovirt.engine.api.model.Network entity , boolean isDisplay , boolean isRequired , int index ) { org.ovirt.engine.core.common.businessentities.network.NetworkCluster networkCluster = new org.ovirt.engine.core.common.businessentities.network.NetworkCluster ( ) ; networkCluster.setDisplay ( isDisplay ) ; networkCluster.setRequired ( isRequired ) ; org.easymock.EasyMock.expect ( entity.getCluster ( ) ) . andReturn ( networkCluster ) . anyTimes ( ) ; return org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.setUpEntityExpectations ( entity , index ) ; }

Target:
static org.ovirt.engine.api.model.Network setUpEntityExpectations ( org.ovirt.engine.api.model.Network entity , boolean isDisplay , boolean isMigration , boolean isRequired , int index ) { org.ovirt.engine.core.common.businessentities.network.NetworkCluster networkCluster = new org.ovirt.engine.core.common.businessentities.network.NetworkCluster ( ) ; networkCluster.setDisplay ( isDisplay ) ; networkCluster.setMigration ( isMigration ) ; networkCluster.setRequired ( isRequired ) ; org.easymock.EasyMock.expect ( entity.getCluster ( ) ) . andReturn ( networkCluster ) . anyTimes ( ) ; return org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.setUpEntityExpectations ( entity , index ) ; }
Source:
public void getMaxNumOfVmCpus ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { 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 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfVmCpus ) ; tempVar.setVersion ( version ) ; getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public void getMaxNumOfThreadsPerCpu ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { 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 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfThreadsPerCpu ) ; tempVar.setVersion ( version ) ; getConfigFromCache ( tempVar , aQuery ) ; }
Source:
protected java.lang.String getFingerprint ( org.ovirt.engine.core.utils.ssh.SSHClient client ) { java.security.PublicKey hostKey = client.getHostKey ( ) ; if ( hostKey == null ) { log.error ( "Could not get server key" ) ; return null ; } return org.ovirt.engine.core.utils.crypt.OpenSSHUtils.getKeyFingerprintString ( hostKey ) ; }

Target:
public java.lang.String getFingerprint ( java.lang.String hostName ) { org.ovirt.engine.core.utils.ssh.EngineSSHClient client = null ; try { client = connect ( hostName ) ; return client.getHostFingerprint ( ) ; } catch ( java.io.IOException e ) { log.error ( "Could not get server key" ) ; return null ; } finally { if ( client != null ) { client.disconnect ( ) ; } } }
Source:
private static void injectCopyrightHeader ( java.io.File file ) { java.lang.StringBuffer content = new java.lang.StringBuffer ( ) ; try { content.append ( org.ovirt.engine.sdk.codegen.xsd.XsdCodegen.copyrightTemplate ) ; content.append ( org.ovirt.engine.sdk.codegen.utils.FileUtils.getFileContent ( file.getAbsolutePath ( ) ) ) ; org.ovirt.engine.sdk.codegen.utils.FileUtils.saveFile ( file.getAbsolutePath ( ) , content.toString ( ) ) ; } catch ( java.io.FileNotFoundException e ) { e.printStackTrace ( ) ; } }

Target:
private static void injectCopyrightHeader ( java.io.File file ) throws java.io.IOException { java.util.List < java.lang.String > lines = new java.util.ArrayList < > ( org.ovirt.engine.sdk.codegen.xsd.XsdCodegen.copyrightLines ) ; lines.addAll ( org.apache.commons.io.FileUtils.readLines ( file ) ) ; lines = org.ovirt.engine.sdk.codegen.utils.StringUtils.removeTrailingWhitespace ( lines ) ; org.apache.commons.io.FileUtils.writeLines ( file , lines ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeBrickAdd ( java.lang.String volumeName , java.lang.String [ ] bricks , int replicaCount , int stripeCount ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeBrickAdd ( volumeName , bricks , replicaCount , stripeCount ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( 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.VMNamesListReturnForXmlRpc getExternalVmNamesList ( java.lang.String uri , java.lang.String username , java.lang.String password ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getExternalVMsNames ( uri , username , password ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VMNamesListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.VMNamesListReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }