auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void shouldElectActiveSharedBeforeLocalDataDomain2 ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain localDomain = createDataStorageDomain ( StorageDomainStatus.Active , "local domain name" , LOCAL_SD_ID ) ; localDomain.setStorageType ( StorageType.LOCALFS ) ; org.ovirt.engine.core.common.businessentities.StorageDomain sharedDomain = createDataStorageDomain ( StorageDomainStatus.Active , "shared domain name" , SHARED_SD_ID ) ; org.mockito.Mockito.when ( storageDomainDao.getAllForStoragePool ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Arrays.asList ( sharedDomain , localDomain ) ) ; cmd.setStoragePool ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; org.junit.Assert.assertEquals ( sharedDomain , cmd.electNewMaster ( ) ) ; }

Target:
public void shouldElectActiveSharedBeforeLocalDataDomain2 ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain localDomain = createDataStorageDomain ( StorageDomainStatus.Active , "local domain name" , LOCAL_SD_ID ) ; localDomain.setStorageType ( StorageType.LOCALFS ) ; org.ovirt.engine.core.common.businessentities.StorageDomain sharedDomain = createDataStorageDomain ( StorageDomainStatus.Active , "shared domain name" , SHARED_SD_ID ) ; org.mockito.Mockito.when ( storageDomainDao.getAllForStoragePool ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( java.util.Arrays.asList ( sharedDomain , localDomain ) ) ; cmd.setStoragePool ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; org.junit.Assert.assertEquals ( sharedDomain , cmd.electNewMaster ( ) ) ; }
Source:
public java.lang.Integer getReplicaCountValue ( ) { if ( ( replicaCount.getEntity ( ) ) instanceof java.lang.String ) { return java.lang.Integer.parseInt ( ( ( java.lang.String ) ( replicaCount.getEntity ( ) ) ) ) ; } else { return ( ( java.lang.Integer ) ( replicaCount.getEntity ( ) ) ) ; } }

Target:
public java.lang.Integer getReplicaCountValue ( ) { return replicaCount.getEntity ( ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.VDS > uniteAgents ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList ) { java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > > vdsMap = getVdsMap ( vdsList ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > results = new java.util.ArrayList < > ( ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > > entry : vdsMap.entrySet ( ) ) { results.add ( uniteAgentsSingleVds ( entry.getValue ( ) ) ) ; } return results ; }

Target:
private org.ovirt.engine.core.common.businessentities.VDS uniteAgentsSingleVds ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList ) { return uniteAgents ( vdsList ) . get ( 0 ) ; }
Source:
public boolean checkQuotaNameExisting ( org.ovirt.engine.core.common.businessentities.Quota quota , java.util.List < java.lang.String > messages ) { org.ovirt.engine.core.common.businessentities.Quota quotaByName = getQuotaDao ( ) . getQuotaByQuotaName ( quota.getQuotaName ( ) ) ; if ( ( quotaByName != null ) && ( ! ( quotaByName.getId ( ) . equals ( quota.getId ( ) ) ) ) ) { messages.add ( EngineMessage.ACTION_TYPE_FAILED_NAME_ALREADY_USED.toString ( ) ) ; return false ; } return true ; }

Target:
public boolean checkQuotaNameExisting ( org.ovirt.engine.core.common.businessentities.Quota quota , java.util.List < java.lang.String > messages ) { org.ovirt.engine.core.common.businessentities.Quota quotaByName = getQuotaDao ( ) . getQuotaByQuotaName ( quota.getQuotaName ( ) , quota.getStoragePoolId ( ) ) ; if ( ( quotaByName != null ) && ( ! ( quotaByName.getId ( ) . equals ( quota.getId ( ) ) ) ) ) { messages.add ( EngineMessage.ACTION_TYPE_FAILED_NAME_ALREADY_USED.toString ( ) ) ; return false ; } return true ; }
Source:
public void testEchoStdout ( ) throws java.lang.Exception { java.lang.String content = "hello\nworld!\nother\ndata" ; java.io.InputStream stdin = new java.io.ByteArrayInputStream ( content.getBytes ( "UTF-8" ) ) ; java.io.ByteArrayOutputStream stdout = new java.io.ByteArrayOutputStream ( ) ; java.io.ByteArrayOutputStream stderr = new java.io.ByteArrayOutputStream ( ) ; client.executeCommand ( "cat" , stdin , stdout , stderr ) ; org.junit.Assert.assertEquals ( content , new java.lang.String ( stdout.toByteArray ( ) , "UTF-8" ) ) ; org.junit.Assert.assertEquals ( 0 , stderr.size ( ) ) ; }

Target:
public void testEchoStdout ( ) throws java.lang.Exception { java.lang.String content = "hello\nworld!\nother\ndata" ; try ( final java.io.InputStream stdin = new java.io.ByteArrayInputStream ( content.getBytes ( "UTF-8" ) ) ; final java.io.ByteArrayOutputStream stdout = new java.io.ByteArrayOutputStream ( ) ; final java.io.ByteArrayOutputStream stderr = new java.io.ByteArrayOutputStream ( ) ) { client.executeCommand ( "cat" , stdin , stdout , stderr ) ; org.junit.Assert.assertEquals ( content , new java.lang.String ( stdout.toByteArray ( ) , "UTF-8" ) ) ; org.junit.Assert.assertEquals ( 0 , stderr.size ( ) ) ; } }
Source:
private void requireAll ( java.lang.String ... mandatoryProperties ) { for ( java.lang.String property : mandatoryProperties ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( getProperty ( property , true ) ) ) { throw new java.lang.IllegalArgumentException ( java.lang.String.format ( ( ( org.ovirt.engine.core.notifier.utils.NotificationProperties.GENERIC_MESSAGE ) + "'%s' is missing" ) , property ) ) ; } } }

Target:
public void requireAll ( java.lang.String ... mandatoryProperties ) { for ( java.lang.String property : mandatoryProperties ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( getProperty ( property , true ) ) ) { throw new java.lang.IllegalArgumentException ( java.lang.String.format ( ( ( org.ovirt.engine.core.notifier.utils.NotificationProperties.GENERIC_MESSAGE ) + "'%s' is missing" ) , property ) ) ; } } }
Source:
private void setCustomDefinedProperties ( org.ovirt.engine.core.common.businessentities.VmStatic vmStaticDataFromParams ) { org.ovirt.engine.core.utils.vmproperties.VmPropertiesUtils.VMCustomProperties properties = org.ovirt.engine.core.utils.vmproperties.VmPropertiesUtils.getInstance ( ) . parseProperties ( org.ovirt.engine.core.bll.UpdateVmCommand.getVdsGroupDAO ( ) . get ( org.ovirt.engine.core.bll.UpdateVmCommand.getParameters ( ) . getVm ( ) . getvds_group_id ( ) ) . getcompatibility_version ( ) , vmStaticDataFromParams.getCustomProperties ( ) ) ; vmStaticDataFromParams.setPredefinedProperties ( properties.getPredefinedProperties ( ) ) ; vmStaticDataFromParams.setUserDefinedProperties ( properties.getUseDefinedProperties ( ) ) ; }

Target:
private void setCustomDefinedProperties ( org.ovirt.engine.core.common.businessentities.VmStatic vmStaticDataFromParams ) { org.ovirt.engine.core.utils.vmproperties.VmPropertiesUtils.VMCustomProperties properties = org.ovirt.engine.core.utils.vmproperties.VmPropertiesUtils.getInstance ( ) . parseProperties ( org.ovirt.engine.core.bll.UpdateVmCommand.getVdsGroup ( ) . getcompatibility_version ( ) , vmStaticDataFromParams.getCustomProperties ( ) ) ; vmStaticDataFromParams.setPredefinedProperties ( properties.getPredefinedProperties ( ) ) ; vmStaticDataFromParams.setUserDefinedProperties ( properties.getUseDefinedProperties ( ) ) ; }
Source:
private void addVmToDb ( ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { addVmStatic ( ) ; addVmDynamic ( ) ; addVmInterfaces ( ) ; addVmStatistics ( ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; } } ) ; freeLock ( ) ; }

Target:
private void addVmToDb ( ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { addVmStatic ( ) ; addVmDynamic ( ) ; addVmInterfaces ( ) ; addVmStatistics ( ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; } } ) ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 0 ) ; setUpGetEntityExpectations ( 0 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateTag , org.ovirt.engine.core.common.action.TagsOperationParameters.class , new java.lang.String [ ] { "Tag.tag_name" , "Tag.parent_id" } , new java.lang.Object [ ] { NAMES [ 0 ] , org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.PARENT_GUID } , true , true ) ) ; verifyModel ( resource.update ( org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.getModel ( 0 , false ) ) , 0 ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 0 ) ; setUpGetEntityExpectations ( 0 ) ; setUpGetEntityExpectations ( 0 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateTag , org.ovirt.engine.core.common.action.TagsOperationParameters.class , new java.lang.String [ ] { "Tag.tag_name" , "Tag.parent_id" } , new java.lang.Object [ ] { NAMES [ 0 ] , org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.PARENT_GUID } , true , true ) ) ; verifyModel ( resource.update ( org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.getModel ( 0 , false ) ) , 0 ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createVlan ( java.lang.String baseIfaceName , int vlanId , java.lang.String networkName ) { return createVdsInterface ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , ( ( baseIfaceName + "." ) + vlanId ) , false , null , vlanId , networkName , true , null , false , null ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createVlan ( java.lang.String baseIfaceName , int vlanId , java.lang.String networkName ) { return createVdsInterface ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , ( ( baseIfaceName + "." ) + vlanId ) , false , null , baseIfaceName , vlanId , networkName , true , null , false , null ) ; }
Source:
public void template_SelectedItemChanged ( ) { super . template_SelectedItemChanged ( ) ; org.ovirt.engine.core.common.businessentities.VmTemplate template = getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ; if ( template == null ) { return ; } setupWindowModelFrom ( template ) ; updateHostPinning ( template.getMigrationSupport ( ) ) ; doChangeDefautlHost ( template.getDedicatedVmForVds ( ) ) ; }

Target:
public void template_SelectedItemChanged ( ) { super . template_SelectedItemChanged ( ) ; org.ovirt.engine.core.common.businessentities.VmTemplate template = getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ; if ( template == null ) { return ; } setupWindowModelFrom ( template ) ; doChangeDefautlHost ( template.getDedicatedVmForVds ( ) ) ; }
Source:
public void testCheckAddEditValidations ( ) { org.ovirt.engine.core.compat.Guid clusterPolicyId = new org.ovirt.engine.core.compat.Guid ( "e754440b-76a6-4099-8235-4565ab4b5521" ) ; org.ovirt.engine.core.common.scheduling.ClusterPolicy clusterPolicy = new org.ovirt.engine.core.common.scheduling.ClusterPolicy ( ) ; clusterPolicy.setId ( clusterPolicyId ) ; org.ovirt.engine.core.bll.scheduling.commands.ClusterPolicyCRUDCommand command = new org.ovirt.engine.core.bll.scheduling.commands.ClusterPolicyCRUDCommand ( new org.ovirt.engine.core.common.scheduling.parameters.ClusterPolicyCRUDParameters ( clusterPolicyId , clusterPolicy ) , null ) { @ java.lang.Override protected void executeCommand ( ) { } } ; command.schedulingManager = schedulingManager ; org.junit.Assert.assertTrue ( command.checkAddEditValidations ( ) ) ; }

Target:
public void testCheckAddEditValidations ( ) { org.junit.Assert.assertTrue ( command.checkAddEditValidations ( ) ) ; }
Source:
public void testListNonIso ( ) throws java.lang.Exception { try { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; setupGetStorageDomainExpectations ( StorageDomainType.Data ) ; control.replay ( ) ; collection.setUriInfo ( uriInfo ) ; verifyCollection ( getCollection ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testListNonIso ( ) throws java.lang.Exception { try { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; setupGetStorageDomainExpectations ( StorageDomainType.Data ) ; collection.setUriInfo ( uriInfo ) ; verifyCollection ( getCollection ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public static org.ovirt.engine.core.common.businessentities.VmDevice addManagedDevice ( org.ovirt.engine.core.common.businessentities.VmDeviceId id , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType generalType , org.ovirt.engine.core.common.utils.VmDeviceType type , java.util.Map < java.lang.String , java.lang.Object > specParams , boolean isPlugged , java.lang.Boolean isReadOnly ) { return org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( id , generalType , type , specParams , isPlugged , isReadOnly , "" , null , false ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.VmDevice addManagedDevice ( org.ovirt.engine.core.common.businessentities.VmDeviceId id , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType generalType , org.ovirt.engine.core.common.utils.VmDeviceType type , java.util.Map < java.lang.String , java.lang.Object > specParams , boolean isPlugged , java.lang.Boolean isReadOnly ) { return addManagedDevice ( id , generalType , type , specParams , isPlugged , isReadOnly , "" , null , false ) ; }
Source:
private void setupCanImportPpcTest ( ) { setupDiskSpaceTest ( ) ; cmd.getParameters ( ) . getVm ( ) . setClusterArch ( ArchitectureType.ppc64 ) ; org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setArchitecture ( ArchitectureType.ppc64 ) ; cluster.setCompatibilityVersion ( org.ovirt.engine.core.compat.Version.getLast ( ) ) ; org.mockito.Mockito.doReturn ( cluster ) . when ( cmd ) . getCluster ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateImages ( org.mockito.ArgumentMatchers.anyMap ( ) ) ; }

Target:
private void setupCanImportPpcTest ( ) { setupDiskSpaceTest ( ) ; cmd.getParameters ( ) . getVm ( ) . setClusterArch ( ArchitectureType.ppc64 ) ; org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setArchitecture ( ArchitectureType.ppc64 ) ; cluster.setCompatibilityVersion ( org.ovirt.engine.core.compat.Version.getLast ( ) ) ; org.mockito.Mockito.doReturn ( cluster ) . when ( cmd ) . getCluster ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateImages ( org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
public void canDoActionThinProvisioningSpaceCheckSucceeds ( ) throws java.lang.Exception { final int availableSize = 6 ; final int usedSize = 4 ; org.ovirt.engine.core.compat.Guid sdid = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; initializeCommand ( sdid , VolumeType.Sparse ) ; mockVm ( ) ; org.ovirt.engine.core.common.businessentities.storage_domains domains = mockStorageDomain ( sdid , availableSize , usedSize ) ; mockStoragePoolIsoMap ( ) ; mockStorageDomainSpaceChecker ( domains , true ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; }

Target:
public void canDoActionThinProvisioningSpaceCheckSucceeds ( ) throws java.lang.Exception { final int availableSize = 6 ; final int usedSize = 4 ; org.ovirt.engine.core.compat.Guid sdid = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; initializeCommand ( sdid , VolumeType.Sparse ) ; mockVm ( ) ; org.ovirt.engine.core.common.businessentities.storage_domains domains = mockStorageDomain ( sdid , availableSize , usedSize ) ; mockStoragePoolIsoMap ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; }
Source:
public static org.ovirt.engine.api.model.SerialNumber map ( org.ovirt.engine.core.common.businessentities.HasSerialNumberPolicy entity , org.ovirt.engine.api.model.SerialNumber template ) { if ( template == null ) { template = new org.ovirt.engine.api.model.SerialNumber ( ) ; } org.ovirt.engine.api.model.SerialNumberPolicy policy = org.ovirt.engine.api.restapi.types.SerialNumberMapper.map ( entity.getSerialNumberPolicy ( ) , null ) ; template.setPolicy ( ( policy == null ? "" : policy.value ( ) ) ) ; template.setValue ( entity.getCustomSerialNumber ( ) ) ; return template ; }

Target:
public static org.ovirt.engine.api.model.SerialNumber map ( org.ovirt.engine.core.common.businessentities.HasSerialNumberPolicy entity , org.ovirt.engine.api.model.SerialNumber template ) { if ( template == null ) { template = new org.ovirt.engine.api.model.SerialNumber ( ) ; } template.setPolicy ( org.ovirt.engine.api.restapi.types.SerialNumberMapper.map ( entity.getSerialNumberPolicy ( ) , null ) ) ; template.setValue ( entity.getCustomSerialNumber ( ) ) ; return template ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isSameStorageType ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { org.ovirt.engine.core.common.businessentities.storage.StorageType connectionStorageType = connection.getstorage_type ( ) ; org.ovirt.engine.core.common.businessentities.storage.StorageType storageDomainType = storageDomain.getStorageType ( ) ; if ( ! ( connectionStorageType.equals ( storageDomainType ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_UNSUPPORTED_ACTION_NOT_SAME_STORAGE_TYPE ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isSameStorageType ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { org.ovirt.engine.core.common.businessentities.storage.StorageType connectionStorageType = connection.getStorageType ( ) ; org.ovirt.engine.core.common.businessentities.storage.StorageType storageDomainType = storageDomain.getStorageType ( ) ; if ( ! ( connectionStorageType.equals ( storageDomainType ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_UNSUPPORTED_ACTION_NOT_SAME_STORAGE_TYPE ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public java.lang.Object getConfigValue ( org.ovirt.engine.core.common.queries.ConfigurationValues configValue , java.lang.String version , org.ovirt.engine.ui.frontend.IAsyncConverter converter ) { if ( converter == null ) { return null ; } org.ovirt.engine.core.compat.KeyValuePairCompat < org.ovirt.engine.core.common.queries.ConfigurationValues , java.lang.String > key = new org.ovirt.engine.core.compat.KeyValuePairCompat < org.ovirt.engine.core.common.queries.ConfigurationValues , java.lang.String > ( configValue , version ) ; return converter.Convert ( cachedConfigValuesPreConvert.get ( key ) , null ) ; }

Target:
public java.lang.Object getConfigValue ( org.ovirt.engine.core.common.queries.ConfigurationValues configValue , java.lang.String version , org.ovirt.engine.ui.frontend.IAsyncConverter converter ) { if ( converter == null ) { return null ; } org.ovirt.engine.core.compat.KeyValuePairCompat < org.ovirt.engine.core.common.queries.ConfigurationValues , java.lang.String > key = new org.ovirt.engine.core.compat.KeyValuePairCompat ( configValue , version ) ; return converter.Convert ( cachedConfigValuesPreConvert.get ( key ) , null ) ; }
Source:
public static java.util.Collection < org.ovirt.engine.core.compat.Guid > getDiskImageIds ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImages ) { java.util.Collection < org.ovirt.engine.core.compat.Guid > result = new java.util.ArrayList < > ( ) ; if ( diskImages != null ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : diskImages ) { result.add ( diskImage.getImageId ( ) ) ; } } return result ; }

Target:
public static java.util.List < org.ovirt.engine.core.compat.Guid > getDiskImageIds ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImages ) { java.util.List < org.ovirt.engine.core.compat.Guid > result = new java.util.ArrayList < > ( ) ; if ( diskImages != null ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : diskImages ) { result.add ( diskImage.getImageId ( ) ) ; } } return result ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult passthroughProfileContainsSupportedProperties ( boolean useDefaultNetworkFilterId ) { boolean nullValuedNetworkFilterWillBeUsed = ( ( vnicProfile.getNetworkFilterId ( ) ) == null ) && ( ! useDefaultNetworkFilterId ) ; boolean conditionOccurs = ( vnicProfile.isPassthrough ( ) ) && ( ( ( vnicProfile.isPortMirroring ( ) ) || ( ( vnicProfile.getNetworkQosId ( ) ) != null ) ) || ( ! nullValuedNetworkFilterWillBeUsed ) ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.ACTION_TYPE_FAILED_PASSTHROUGH_PROFILE_CONTAINS_NOT_SUPPORTED_PROPERTIES ) . when ( conditionOccurs ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult passthroughProfileContainsSupportedProperties ( ) { boolean conditionOccurs = ( vnicProfile.isPassthrough ( ) ) && ( ( ( vnicProfile.isPortMirroring ( ) ) || ( ( vnicProfile.getNetworkQosId ( ) ) != null ) ) || ( ( vnicProfile.getNetworkFilterId ( ) ) != null ) ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.ACTION_TYPE_FAILED_PASSTHROUGH_PROFILE_CONTAINS_NOT_SUPPORTED_PROPERTIES ) . when ( conditionOccurs ) ; }
Source:
public void getVmSwallowsExceptions ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.VM v = null ; b.setVm ( v ) ; b.setVmId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID3 ) ; final org.ovirt.engine.core.common.businessentities.VM vm = b.getVm ( ) ; org.junit.Assert.assertNull ( vm ) ; }

Target:
public void getVmSwallowsExceptions ( ) { final org.ovirt.engine.core.common.businessentities.VM v = null ; b.setVm ( v ) ; b.setVmId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID3 ) ; final org.ovirt.engine.core.common.businessentities.VM vm = b.getVm ( ) ; org.junit.Assert.assertNull ( vm ) ; }
Source:
public java.util.List < java.io.File > getExtensionsDirectories ( ) { java.lang.String path = getProperty ( "ENGINE_EXTENSION_PATH" ) ; if ( path == null ) { return java.util.Collections.emptyList ( ) ; } java.util.List < java.io.File > results = new java.util.ArrayList < java.io.File > ( ) ; for ( java.lang.String currentPath : path.split ( ":" ) ) { if ( org.apache.commons.lang.StringUtils.isNotBlank ( currentPath ) ) { results.add ( new java.io.File ( currentPath ) ) ; } } return results ; }

Target:
public java.util.List < java.io.File > getExtensionsDirectories ( ) { java.lang.String path = getProperty ( "ENGINE_EXTENSION_PATH" , true ) ; if ( path == null ) { return java.util.Collections.emptyList ( ) ; } java.util.List < java.io.File > results = new java.util.ArrayList < java.io.File > ( ) ; for ( java.lang.String currentPath : path.split ( ":" ) ) { if ( org.apache.commons.lang.StringUtils.isNotBlank ( currentPath ) ) { results.add ( new java.io.File ( currentPath ) ) ; } } return results ; }
Source:
public void setstatus ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus value ) { org.ovirt.engine.core.common.businessentities.StorageDomainStatus curStatus = getStoragePoolIsoMapData ( ) . getstatus ( ) ; if ( ( curStatus == null ) || ( curStatus != value ) ) { getStoragePoolIsoMapData ( ) . setstatus ( value ) ; OnPropertyChanged ( new org.ovirt.engine.core.compat.PropertyChangedEventArgs ( "status" ) ) ; } }

Target:
public void setstatus ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus value ) { org.ovirt.engine.core.common.businessentities.StorageDomainStatus curStatus = getStoragePoolIsoMapData ( ) . getstatus ( ) ; if ( ( curStatus == null ) || ( curStatus != value ) ) { getStoragePoolIsoMapData ( ) . setstatus ( value ) ; } }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > disks = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ) ( returnValue ) ) ; getVmDisks ( ) . clear ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : disks ) { if ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.LUN ) ) { continue ; } org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) ; getVmDisks ( ) . add ( diskImage ) ; } }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { getVmDisks ( ) . clear ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : disks ) { if ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.LUN ) ) { continue ; } org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) ; getVmDisks ( ) . add ( diskImage ) ; } }
Source:
protected org.ovirt.engine.api.model.Disk postPopulate ( org.ovirt.engine.api.model.Disk model ) { model.setFormat ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.DiskFormat.class ) ) ; model.setInterface ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.DiskInterface.class ) ) ; model.setSgio ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.ScsiGenericIO.class ) ) ; model.setStatus ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.DiskStatus.class ) ) ; model.setLunStorage ( null ) ; return model ; }

Target:
protected org.ovirt.engine.api.model.Disk postPopulate ( org.ovirt.engine.api.model.Disk model ) { model.setFormat ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.DiskFormat.class ) ) ; model.setSgio ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.ScsiGenericIO.class ) ) ; model.setStatus ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.DiskStatus.class ) ) ; model.setLunStorage ( null ) ; return model ; }
Source:
public void storagePool ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.storage_pool p = new org.ovirt.engine.core.common.businessentities.storage_pool ( ) ; b.setStoragePool ( p ) ; final org.ovirt.engine.core.common.businessentities.storage_pool sp = b.getStoragePool ( ) ; org.junit.Assert.assertEquals ( p , sp ) ; }

Target:
public void storagePool ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.StoragePool p = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; b.setStoragePool ( p ) ; final org.ovirt.engine.core.common.businessentities.StoragePool sp = b.getStoragePool ( ) ; org.junit.Assert.assertEquals ( p , sp ) ; }
Source:
public void onSuccess ( java.lang.Object returnValue ) { final java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenters = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool prevDataCenter = getPreviousDataCenter ( dataCenters ) ; java.util.Collections.sort ( dataCenters , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; dataCenters.add ( 0 , null ) ; getDataCenter ( ) . setItems ( dataCenters ) ; getDataCenter ( ) . setSelectedItem ( prevDataCenter ) ; if ( ( getDataCenter ( ) . getSelectedItem ( ) ) == null ) { getProxyHostPropertiesModel ( ) . disableProxyHost ( ) ; } }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenters ) { org.ovirt.engine.core.common.businessentities.StoragePool prevDataCenter = getPreviousDataCenter ( dataCenters ) ; java.util.Collections.sort ( dataCenters , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; dataCenters.add ( 0 , null ) ; getDataCenter ( ) . setItems ( dataCenters ) ; getDataCenter ( ) . setSelectedItem ( prevDataCenter ) ; if ( ( getDataCenter ( ) . getSelectedItem ( ) ) == null ) { getProxyHostPropertiesModel ( ) . disableProxyHost ( ) ; } }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getDbFacade ( ) . getVdsDao ( ) . get ( org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getParameters ( ) . getVdsId ( ) , org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getParameters ( ) . isFiltered ( ) ) ; if ( vds != null ) { vds.setCpuName ( org.ovirt.engine.core.bll.CpuFlagsManagerHandler.FindMaxServerCpuByFlags ( vds.getCpuFlags ( ) , vds.getVdsGroupCompatibilityVersion ( ) ) ) ; } org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getQueryReturnValue ( ) . setReturnValue ( vds ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getDbFacade ( ) . getVdsDao ( ) . get ( org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getParameters ( ) . getVdsId ( ) ) ; if ( vds != null ) { vds.setCpuName ( org.ovirt.engine.core.bll.CpuFlagsManagerHandler.FindMaxServerCpuByFlags ( vds.getCpuFlags ( ) , vds.getVdsGroupCompatibilityVersion ( ) ) ) ; } org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getQueryReturnValue ( ) . setReturnValue ( vds ) ; }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 0 , true ) ; control.replay ( ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 0 , true ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.configure.scheduling.ClusterPolicyListModel clusterPolicyListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.configure.scheduling.ClusterPolicyListModel ) ( model ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.scheduling.PolicyUnit > list = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; clusterPolicyListModel.setPolicyUnits ( list ) ; clusterPolicyListModel.fetchClusterPolicies ( ) ; if ( ( policyUnitModel ) != null ) { policyUnitModel.getPolicyUnits ( ) . setItems ( sort ( policyUnits ) ) ; } }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.scheduling.PolicyUnit > list = returnValue.getReturnValue ( ) ; setPolicyUnits ( list ) ; fetchClusterPolicies ( ) ; if ( ( policyUnitModel ) != null ) { policyUnitModel.getPolicyUnits ( ) . setItems ( sort ( policyUnits ) ) ; } }
Source:
protected void initVmForSpace ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Down ) ; org.mockito.Mockito.when ( vmDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vm ) ; java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.common.businessentities.VmDevice > > vmList = java.util.Collections.singletonList ( new org.ovirt.engine.core.common.utils.Pair ( vm , vmDevice ) ) ; org.mockito.Mockito.when ( vmDao.getVmsWithPlugInfo ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vmList ) ; }

Target:
protected void initVmForSpace ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Down ) ; org.mockito.Mockito.when ( vmDao.get ( org.mockito.Matchers.any ( ) ) ) . thenReturn ( vm ) ; java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.common.businessentities.VmDevice > > vmList = java.util.Collections.singletonList ( new org.ovirt.engine.core.common.utils.Pair ( vm , vmDevice ) ) ; org.mockito.Mockito.when ( vmDao.getVmsWithPlugInfo ( org.mockito.Matchers.any ( ) ) ) . thenReturn ( vmList ) ; }
Source:
public void testValidate ( ) { org.ovirt.engine.core.searchbackend.IAutoCompleter comp = new org.ovirt.engine.core.searchbackend.BitValueAutoCompleter ( ) ; org.junit.Assert.assertTrue ( "true" , comp.validate ( "true" ) ) ; org.junit.Assert.assertTrue ( "TRUE" , comp.validate ( "TRUE" ) ) ; org.junit.Assert.assertFalse ( "JarJar" , comp.validate ( "JarJar" ) ) ; }

Target:
public void testValidate ( ) { org.junit.Assert.assertTrue ( "true" , comp.validate ( "true" ) ) ; org.junit.Assert.assertTrue ( "TRUE" , comp.validate ( "TRUE" ) ) ; org.junit.Assert.assertFalse ( "JarJar" , comp.validate ( "JarJar" ) ) ; }
Source:
public static java.util.Map < java.lang.String , java.lang.Object > getVideoDeviceSpecParams ( org.ovirt.engine.core.common.businessentities.VmBase vmBase ) { return org.ovirt.engine.core.bll.utils.VideoDeviceSettings.getVideoDeviceSettings ( vmBase ) . entrySet ( ) . stream ( ) . collect ( java.util.stream.Collectors.toMap ( java.util.Map.Entry :: getKey , ( e ) -> java.lang.String.valueOf ( e.getValue ( ) ) ) ) ; }

Target:
public java.util.Map < java.lang.String , java.lang.Object > getVideoDeviceSpecParams ( org.ovirt.engine.core.common.businessentities.VmBase vmBase ) { return getVideoDeviceSettings ( vmBase ) . entrySet ( ) . stream ( ) . collect ( java.util.stream.Collectors.toMap ( java.util.Map.Entry :: getKey , ( e ) -> java.lang.String.valueOf ( e.getValue ( ) ) ) ) ; }
Source:
public static void getStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.StorageDomainQueryParametersBase ( storageDomainId ) , aQuery ) ; }

Target:
public static void getStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
protected void runRemoveAllAndVerify ( boolean removeFromPool , org.mockito.verification.VerificationMode freeMacVerification ) { 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 ( removeFromPool , org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface iface : interfaces ) { verifyRemoveAllDelegatedCorrectly ( iface , freeMacVerification ) ; } }

Target:
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 ) ; } }
Source:
public void testCleanExpiredUsersSessionsWithUsers ( ) { org.ovirt.engine.core.dao.DbUserDAO dbUserDAOMcok = initDataForClearTest ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER ) ; container.cleanExpiredUsersSessions ( ) ; container.cleanExpiredUsersSessions ( ) ; org.junit.Assert.assertNull ( "Get should return null since the session was removed" , container.GetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER , false ) ) ; org.junit.Assert.assertNull ( "Get should return null since the session was removed" , container.getUser ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , false ) ) ; org.mockito.Mockito.verify ( dbUserDAOMcok ) . removeUserSessions ( org.mockito.Matchers.anyMap ( ) ) ; }

Target:
public void testCleanExpiredUsersSessionsWithUsers ( ) { initDataForClearTest ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER ) ; container.cleanExpiredUsersSessions ( ) ; container.cleanExpiredUsersSessions ( ) ; org.junit.Assert.assertNull ( "Get should return null since the session was removed" , container.GetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER , false ) ) ; org.junit.Assert.assertNull ( "Get should return null since the session was removed" , container.getUser ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , false ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VmInitNetwork createVmInitNetwork ( ) { final org.ovirt.engine.core.common.businessentities.VmInitNetwork vmInitNetwork = new org.ovirt.engine.core.common.businessentities.VmInitNetwork ( ) ; vmInitNetwork.setName ( org.ovirt.engine.core.vdsbroker.vdsbroker.CloudInitHandlerTest.IFACE_NAME ) ; vmInitNetwork.setBootProtocol ( Ipv4BootProtocol.STATIC_IP ) ; vmInitNetwork.setIp ( org.ovirt.engine.core.vdsbroker.vdsbroker.CloudInitHandlerTest.IPV4_ADDRESS ) ; vmInitNetwork.setNetmask ( org.ovirt.engine.core.vdsbroker.vdsbroker.CloudInitHandlerTest.IPV4_NETMASK ) ; vmInitNetwork.setGateway ( org.ovirt.engine.core.vdsbroker.vdsbroker.CloudInitHandlerTest.IPV4_GATEWAY ) ; vmInitNetwork.setIpv6BootProtocol ( Ipv6BootProtocol.STATIC_IP ) ; vmInitNetwork.setIpv6Address ( org.ovirt.engine.core.vdsbroker.vdsbroker.CloudInitHandlerTest.IPV6_ADDRESS ) ; vmInitNetwork.setIpv6Prefix ( org.ovirt.engine.core.vdsbroker.vdsbroker.CloudInitHandlerTest.IPV6_PREFIX ) ; vmInitNetwork.setIpv6Gateway ( org.ovirt.engine.core.vdsbroker.vdsbroker.CloudInitHandlerTest.IPV6_GATEWAY ) ; return vmInitNetwork ; }

Target:
private org.ovirt.engine.core.common.businessentities.VmInitNetwork createVmInitNetwork ( ) { final org.ovirt.engine.core.common.businessentities.VmInitNetwork vmInitNetwork = new org.ovirt.engine.core.common.businessentities.VmInitNetwork ( ) ; vmInitNetwork.setName ( org.ovirt.engine.core.vdsbroker.vdsbroker.CloudInitHandlerTest.IFACE_NAME ) ; vmInitNetwork.setBootProtocol ( Ipv4BootProtocol.STATIC_IP ) ; vmInitNetwork.setIp ( org.ovirt.engine.core.vdsbroker.vdsbroker.CloudInitHandlerTest.IPV4_ADDRESS ) ; vmInitNetwork.setNetmask ( org.ovirt.engine.core.vdsbroker.vdsbroker.CloudInitHandlerTest.IPV4_NETMASK ) ; vmInitNetwork.setGateway ( org.ovirt.engine.core.vdsbroker.vdsbroker.CloudInitHandlerTest.IPV4_GATEWAY ) ; return vmInitNetwork ; }
Source:
public void testExecuteCommandByClusterIdForRestart ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.ManageGlusterServiceCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , null , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT , org.ovirt.engine.core.common.constants.gluster.GlusterConstants.MANAGE_GLUSTER_SERVICE_ACTION_TYPE_RESTART ) , null ) ) ; setUpMockUpForRestart ( ) ; mockBackend ( true , null , GlusterServiceStatus.RUNNING ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( serverServiceDao , org.mockito.Mockito.times ( 4 ) ) . updateByServerIdAndServiceType ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService.class ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_SERVICE_RESTARTED ) ; }

Target:
public void testExecuteCommandByClusterIdForRestart ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.ManageGlusterServiceCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , null , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT , org.ovirt.engine.core.common.constants.gluster.GlusterConstants.MANAGE_GLUSTER_SERVICE_ACTION_TYPE_RESTART ) , null ) ) ; setUpMockUpForRestart ( ) ; mockBackend ( true , null , GlusterServiceStatus.RUNNING ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( serverServiceDao , org.mockito.Mockito.times ( 4 ) ) . updateByServerIdAndServiceType ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService.class ) ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_SERVICE_RESTARTED , cmd.getAuditLogTypeValue ( ) ) ; }
Source:
private void onAdItemsLoaded ( org.ovirt.engine.ui.uicommonweb.models.users.AdElementListModel adElementListModel , java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.aaa.DbUser > > userOrGroups ) { getSearchInProgress ( ) . setEntity ( false ) ; java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.aaa.DbUser > > items = new java.util.ArrayList < > ( ) ; items.addAll ( userOrGroups ) ; adElementListModel.getSelectAll ( ) . setEntity ( false ) ; adElementListModel.setItems ( items ) ; setIsEmpty ( items.isEmpty ( ) ) ; }

Target:
private void onAdItemsLoaded ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.aaa.DbUser > > userOrGroups ) { getSearchInProgress ( ) . setEntity ( false ) ; java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.aaa.DbUser > > items = new java.util.ArrayList < > ( ) ; items.addAll ( userOrGroups ) ; getSelectAll ( ) . setEntity ( false ) ; setItems ( items ) ; setIsEmpty ( items.isEmpty ( ) ) ; }
Source:
public java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > getDisksModels ( ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > diskModels = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : getDisks ( ) ) { org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel = new org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ( ) ; diskModel.setDisk ( diskImage ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel storageDomain = new org.ovirt.engine.ui.uicommonweb.models.ListModel ( ) ; storageDomain.setSelectedItem ( getStorageDomain ( ) ) ; diskModel.setStorageDomain ( storageDomain ) ; diskModels.add ( diskModel ) ; } return diskModels ; }

Target:
public java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > getDisksModels ( ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > diskModels = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : getDisks ( ) ) { org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel = new org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ( ) ; diskModel.setDisk ( diskImage ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomain = new org.ovirt.engine.ui.uicommonweb.models.ListModel ( ) ; storageDomain.setSelectedItem ( getStorageDomain ( ) ) ; diskModel.setStorageDomain ( storageDomain ) ; diskModels.add ( diskModel ) ; } return diskModels ; }
Source:
private java.lang.Object getSessionsVDSReturnVal ( boolean ret , int count ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsRetValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; vdsRetValue.setSucceeded ( ret ) ; if ( ret ) { vdsRetValue.setReturnValue ( getSessions ( count ) ) ; } else { vdsRetValue.setReturnValue ( null ) ; } return vdsRetValue ; }

Target:
private java.lang.Object getSessionsVDSReturnVal ( boolean ret , int count ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsRetValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; vdsRetValue.setSucceeded ( ret ) ; if ( ret ) { vdsRetValue.setReturnValue ( getSessions ( count , false ) ) ; } else { vdsRetValue.setReturnValue ( null ) ; } return vdsRetValue ; }
Source:
public static void getRoleList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }

Target:
public static void getRoleList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }