auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public org.ovirt.engine.ui.uicommonweb.validation.ValidationResult Validate ( java.lang.String value ) { org.ovirt.engine.ui.uicommonweb.validation.ValidationResult result = new org.ovirt.engine.ui.uicommonweb.validation.ValidationResult ( ) ; try { new org.ovirt.engine.ui.uicompat.MailAddress ( value ) ; } catch ( java.lang.RuntimeException e ) { result.setSuccess ( false ) ; result.getReasons ( ) . add ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . invalidEmailAddressInvalidReason ( ) ) ; } return result ; }

Target:
public org.ovirt.engine.ui.uicommonweb.validation.ValidationResult validate ( java.lang.Object value ) { org.ovirt.engine.ui.uicommonweb.validation.ValidationResult result = new org.ovirt.engine.ui.uicommonweb.validation.ValidationResult ( ) ; try { new org.ovirt.engine.ui.uicompat.MailAddress ( ( ( java.lang.String ) ( value ) ) ) ; } catch ( java.lang.RuntimeException e ) { result.setSuccess ( false ) ; result.getReasons ( ) . add ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . invalidEmailAddressInvalidReason ( ) ) ; } return result ; }
Source:
protected void setUpAddExpectations ( ) throws java.lang.Exception { setUriInfo ( org.ovirt.engine.api.restapi.resource.BackendTemplatesBasedResourceTest.setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.restapi.resource.BackendTemplatesBasedResourceTest.setUpHttpHeaderExpectations ( "Expect" , "201-created" ) ; setUpGetVirtioScsiExpectations ( new int [ ] { 0 , 0 } ) ; setUpGetSoundcardExpectations ( new int [ ] { 0 , 0 } ) ; org.ovirt.engine.api.restapi.resource.BackendTemplatesBasedResourceTest.setUpGetRngDeviceExpectations ( new int [ ] { 0 , 0 } ) ; setUpGetEntityExpectations ( 0 ) ; }

Target:
protected void setUpAddExpectations ( ) throws java.lang.Exception { setUriInfo ( org.ovirt.engine.api.restapi.resource.BackendTemplatesBasedResourceTest.setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.restapi.resource.BackendTemplatesBasedResourceTest.setUpHttpHeaderExpectations ( "Expect" , "201-created" ) ; setUpGetVirtioScsiExpectations ( 0 , 0 ) ; setUpGetSoundcardExpectations ( 0 , 0 ) ; org.ovirt.engine.api.restapi.resource.BackendTemplatesBasedResourceTest.setUpGetRngDeviceExpectations ( 0 , 0 ) ; setUpGetEntityExpectations ( 0 ) ; }
Source:
protected void onExportChanged ( ) { if ( ( ( java.lang.Boolean ) ( getExport ( ) . getEntity ( ) ) ) ) { getHasVLanTag ( ) . setIsChangable ( false ) ; getVLanTag ( ) . setIsChangable ( false ) ; getIsVmNetwork ( ) . setIsChangable ( false ) ; getHasMtu ( ) . setIsChangable ( false ) ; getMtu ( ) . setIsChangable ( false ) ; } }

Target:
protected void onExportChanged ( ) { if ( ( ( java.lang.Boolean ) ( getExport ( ) . getEntity ( ) ) ) ) { getHasVLanTag ( ) . setIsChangable ( false ) ; getVLanTag ( ) . setIsChangable ( false ) ; getIsVmNetwork ( ) . setIsChangable ( false ) ; getHasMtu ( ) . setIsChangable ( false ) ; getMtu ( ) . setIsChangable ( false ) ; } super . onExportChanged ( ) ; }
Source:
private boolean addInterfaceToProcessedList ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface ) { if ( ifaceNames.contains ( iface.getName ( ) ) ) { addViolation ( VdcBllMessages.NETWORK_INTERFACES_ALREADY_SPECIFIED , iface.getName ( ) ) ; return false ; } ifaceNames.add ( iface.getName ( ) ) ; return true ; }

Target:
private boolean addInterfaceToProcessedList ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface ) { if ( ifaceNames.contains ( iface.getName ( ) ) ) { addViolation ( VdcBllMessages.NETWORK_INTERFACES_ALREADY_SPECIFIED , iface.getName ( ) ) ; return false ; } ifaceNames.add ( iface.getName ( ) ) ; return true ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.templates.TemplateListModel templateListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.templates.TemplateListModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > storagePools = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool storagePool = ( ( storagePools.size ( ) ) > 0 ) ? storagePools.get ( 0 ) : null ; templateListModel.postGetTemplatesNotPresentOnExportDomain ( storagePool ) ; }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > storagePools ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = ( ( storagePools.size ( ) ) > 0 ) ? storagePools.get ( 0 ) : null ; postGetTemplatesNotPresentOnExportDomain ( storagePool ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.lang.StringBuilder configBuilder = new java.lang.StringBuilder ( ( ( java.lang.String ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ) ; writeOVirtSection ( configBuilder , getOptions ( ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel.makeConsoleConfigRequest ( "console.vv" , "application/x-virt-viewer; charset=UTF-8" , configBuilder.toString ( ) ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { java.lang.StringBuilder configBuilder = new java.lang.StringBuilder ( ( ( java.lang.String ) ( returnValue.getReturnValue ( ) ) ) ) ; writeOVirtSection ( configBuilder , getOptions ( ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel.makeConsoleConfigRequest ( "console.vv" , "application/x-virt-viewer; charset=UTF-8" , configBuilder.toString ( ) ) ; }
Source:
public void setup ( ) { org.mockito.Mockito.doReturn ( affinityGroupDao ) . when ( command ) . getAffinityGroupDao ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.businessentities.Cluster ( ) ) . when ( command ) . getCluster ( ) ; org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; vmStatic.setClusterId ( clusterId ) ; org.mockito.Mockito.doReturn ( vmStatic ) . when ( vmStaticDao ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( clusterId ) . when ( command ) . getClusterId ( ) ; }

Target:
public void setup ( ) { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.businessentities.Cluster ( ) ) . when ( command ) . getCluster ( ) ; org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; vmStatic.setClusterId ( clusterId ) ; org.mockito.Mockito.doReturn ( vmStatic ) . when ( vmStaticDao ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( clusterId ) . when ( command ) . getClusterId ( ) ; }
Source:
private void networkNotUsedByVmsTest ( org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher , java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms ) { org.ovirt.engine.core.dao.VmDao vmDao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VmDao.class ) ; org.mockito.Mockito.when ( vmDao.getAllForNetwork ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vms ) ; org.mockito.Mockito.when ( dbFacade.getVmDao ( ) ) . thenReturn ( vmDao ) ; org.junit.Assert.assertThat ( validator.networkNotUsedByVms ( ) , matcher ) ; }

Target:
private void networkNotUsedByVmsTest ( org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher , java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms ) { org.mockito.Mockito.when ( vmDao.getAllForNetwork ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vms ) ; org.junit.Assert.assertThat ( validator.networkNotUsedByVms ( ) , matcher ) ; }
Source:
public void testAddExistingBlockDomainWhenVgInfoReturnsEmptyLunList ( ) { org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( command ) . getLUNsFromVgInfo ( parameters.getStorageDomain ( ) . getStorage ( ) ) ; org.junit.Assert.assertFalse ( "Could not connect to Storage Domain" , command.canAddDomain ( ) ) ; org.junit.Assert.assertTrue ( "Import block Storage Domain should have failed due to empty Lun list returned from VGInfo " , command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_PROBLEM_WITH_CANDIDATE_INFO.toString ( ) ) ) ; }

Target:
public void testAddExistingBlockDomainWhenVgInfoReturnsEmptyLunList ( ) { org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( command ) . getLUNsFromVgInfo ( ) ; org.junit.Assert.assertFalse ( "Could not connect to Storage Domain" , command.canAddDomain ( ) ) ; org.junit.Assert.assertTrue ( "Import block Storage Domain should have failed due to empty Lun list returned from VGInfo " , command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_PROBLEM_WITH_CANDIDATE_INFO.toString ( ) ) ) ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ) ( source ) ) ; for ( org.ovirt.engine.core.common.businessentities.storage_domains domain : storageDomains ) { if ( ( domain.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) { return domain ; } } return null ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : storageDomains ) { if ( ( domain.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) { return domain ; } } return null ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > allStorageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ) ( source ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > isoStorageDomains = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage_domains storageDomain : allStorageDomains ) { if ( ( storageDomain.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) { isoStorageDomains.add ( storageDomain ) ; } } return isoStorageDomains ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > allStorageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > isoStorageDomains = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain : allStorageDomains ) { if ( ( storageDomain.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) { isoStorageDomains.add ( storageDomain ) ; } } return isoStorageDomains ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; }
Source:
public static org.ovirt.engine.api.model.UsbType getUsbType ( org.ovirt.engine.core.common.businessentities.UsbPolicy usbPolicy ) { org.ovirt.engine.api.model.UsbType usbType = null ; if ( usbPolicy != null ) { if ( org.ovirt.engine.api.restapi.utils.UsbMapperUtils.getIsUsbEnabled ( usbPolicy ) ) { if ( usbPolicy.equals ( UsbPolicy.ENABLED_LEGACY ) ) { usbType = org.ovirt.engine.api.model.UsbType.LEGACY ; } else { usbType = org.ovirt.engine.api.model.UsbType.NATIVE ; } } } return usbType ; }

Target:
public static org.ovirt.engine.api.model.UsbType getUsbType ( org.ovirt.engine.core.common.businessentities.UsbPolicy usbPolicy ) { org.ovirt.engine.api.model.UsbType usbType = null ; if ( usbPolicy != null ) { if ( org.ovirt.engine.api.restapi.utils.UsbMapperUtils.getIsUsbEnabled ( usbPolicy ) ) { usbType = org.ovirt.engine.api.model.UsbType.NATIVE ; } } return usbType ; }
Source:
public java.util.Collection < org.ovirt.engine.api.model.DetailedLink > getLinks ( ) throws java.io.IOException , java.lang.ClassNotFoundException { java.util.List < org.ovirt.engine.api.model.DetailedLink > results = new java.util.ArrayList < org.ovirt.engine.api.model.DetailedLink > ( ) ; for ( java.lang.String path : rels ) { java.lang.Class < ? > resource = findResource ( path ) ; results.addAll ( describe ( resource , path , new java.util.HashMap < java.lang.String , java.lang.reflect.Type > ( ) ) ) ; } return results ; }

Target:
public java.util.Collection < org.ovirt.engine.api.model.DetailedLink > getLinks ( ) throws java.io.IOException , java.lang.ClassNotFoundException { java.util.List < org.ovirt.engine.api.model.DetailedLink > results = new java.util.ArrayList < > ( ) ; for ( java.lang.String path : rels ) { java.lang.Class < ? > resource = findResource ( path ) ; results.addAll ( describe ( resource , path , new java.util.HashMap < > ( ) ) ) ; } return results ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( returnValue ) ) ; registerDiskModel.setQuotaEnforcementType ( dataCenter.getQuotaEnforcementType ( ) ) ; registerDiskModel.setDisks ( org.ovirt.engine.ui.uicommonweb.Linq.disksToDiskModelList ( getSelectedItems ( ) ) ) ; registerDiskModel.updateStorageDomain ( getEntity ( ) ) ; registerDiskModel.stopProgress ( ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.businessentities.StoragePool dataCenter ) { registerDiskModel.setQuotaEnforcementType ( dataCenter.getQuotaEnforcementType ( ) ) ; registerDiskModel.setDisks ( org.ovirt.engine.ui.uicommonweb.Linq.disksToDiskModelList ( getSelectedItems ( ) ) ) ; registerDiskModel.updateStorageDomain ( getEntity ( ) ) ; registerDiskModel.stopProgress ( ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; java.util.Collections.sort ( vms , new org.ovirt.engine.core.common.businessentities.comparators.LexoNumericNameableComparator ( ) ) ; setItems ( vms ) ; setIsEmpty ( ( ( vms.size ( ) ) == 0 ) ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = returnValue.getReturnValue ( ) ; java.util.Collections.sort ( vms , new org.ovirt.engine.core.common.businessentities.comparators.LexoNumericNameableComparator ( ) ) ; setItems ( vms ) ; setIsEmpty ( ( ( vms.size ( ) ) == 0 ) ) ; }
Source:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel object ) { priorityEditor.setRowData ( new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ) ; priorityEditor.edit ( object.getPriority ( ) ) ; org.ovirt.engine.ui.common.widget.uicommon.popup.AbstractVmPopupWidget.Driver.driver.edit ( object ) ; initSliders ( object ) ; initTabAvailabilityListeners ( object ) ; initListeners ( object ) ; initCustomPropertySheet ( object ) ; numOfVmsLabel.setVisible ( false ) ; }

Target:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel object ) { priorityEditor.setRowData ( new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ) ; priorityEditor.edit ( object.getPriority ( ) ) ; org.ovirt.engine.ui.common.widget.uicommon.popup.AbstractVmPopupWidget.Driver.driver.edit ( object ) ; initTabAvailabilityListeners ( object ) ; initListeners ( object ) ; initCustomPropertySheet ( object ) ; numOfVmsLabel.setVisible ( false ) ; }
Source:
public static org.ovirt.engine.core.compat.RpmVersion getOvirtHostOsVersion ( org.ovirt.engine.core.common.businessentities.VDS vds ) { org.ovirt.engine.core.compat.RpmVersion vdsOsVersion = null ; try { vdsOsVersion = new org.ovirt.engine.core.compat.RpmVersion ( vds.getHostOs ( ) , "RHEV Hypervisor -" , true ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.VdsHandler.log.errorFormat ( "Failed to parse version of Host {0},{1} and Host OS '{2}' with error {3}" , vds.getId ( ) , vds.getVdsName ( ) , vds.getHostOs ( ) , org.apache.commons.lang.exception.ExceptionUtils.getMessage ( e ) ) ; } return vdsOsVersion ; }

Target:
public static org.ovirt.engine.core.compat.RpmVersion getOvirtHostOsVersion ( org.ovirt.engine.core.common.businessentities.VDS vds ) { org.ovirt.engine.core.compat.RpmVersion vdsOsVersion = null ; try { vdsOsVersion = new org.ovirt.engine.core.compat.RpmVersion ( vds.getHostOs ( ) , "RHEV Hypervisor -" , true ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.VdsHandler.log.errorFormat ( "Failed to parse version of Host {0},{1} and Host OS '{2}' with error {3}" , vds.getId ( ) , vds.getName ( ) , vds.getHostOs ( ) , org.apache.commons.lang.exception.ExceptionUtils.getMessage ( e ) ) ; } return vdsOsVersion ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetExternalSubnetsOnProviderByExternalNetwork , org.ovirt.engine.core.common.queries.GetExternalSubnetsOnProviderByExternalNetworkQueryParameters.class , new java.lang.String [ ] { "ProviderId" , "NetworkId" } , new java.lang.Object [ ] { GUIDS [ 0 ] , org.ovirt.engine.api.restapi.utils.HexUtils.string2hex ( NAMES [ 1 ] ) } , getSubnets ( ) , failure ) ; control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetExternalSubnetsOnProviderByExternalNetwork , org.ovirt.engine.core.common.queries.GetExternalSubnetsOnProviderByExternalNetworkQueryParameters.class , new java.lang.String [ ] { "ProviderId" , "NetworkId" } , new java.lang.Object [ ] { GUIDS [ 0 ] , org.ovirt.engine.api.restapi.utils.HexUtils.string2hex ( NAMES [ 1 ] ) } , getSubnets ( ) , failure ) ; }
Source:
public void validateVmInPreview ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.when ( snapshotsValidator.vmNotInPreview ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ; }

Target:
public void validateVmInPreview ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.when ( snapshotsValidator.vmNotInPreview ( org.mockito.Matchers.any ( ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ; }
Source:
public void nGuidGuidCtorNull ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( null , null ) ; final org.ovirt.engine.core.compat.Guid g = b.getVdsId ( ) ; org.junit.Assert.assertEquals ( Guid.Empty , g ) ; final org.ovirt.engine.core.compat.Guid gu = b.getVmId ( ) ; org.junit.Assert.assertEquals ( Guid.Empty , gu ) ; }

Target:
public void nGuidGuidCtorNull ( ) { b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( null , null ) ; final org.ovirt.engine.core.compat.Guid g = b.getVdsId ( ) ; org.junit.Assert.assertEquals ( Guid.Empty , g ) ; final org.ovirt.engine.core.compat.Guid gu = b.getVmId ( ) ; org.junit.Assert.assertEquals ( Guid.Empty , gu ) ; }
Source:
private static org.ovirt.engine.core.compat.Guid parent ( org.ovirt.engine.api.model.Tag model , org.ovirt.engine.core.compat.Guid current ) { if ( ( ( model.isSetParent ( ) ) && ( model.getParent ( ) . isSetTag ( ) ) ) && ( model.getParent ( ) . getTag ( ) . isSetId ( ) ) ) { return org.ovirt.engine.api.restapi.utils.GuidUtils.asGuid ( model.getParent ( ) . getTag ( ) . getId ( ) ) ; } else { return current == null ? org.ovirt.engine.core.compat.Guid.Empty : current ; } }

Target:
private static org.ovirt.engine.core.compat.Guid parent ( org.ovirt.engine.api.model.Tag model , org.ovirt.engine.core.compat.Guid current ) { if ( ( model.isSetParent ( ) ) && ( model.getParent ( ) . isSetId ( ) ) ) { return org.ovirt.engine.api.restapi.utils.GuidUtils.asGuid ( model.getParent ( ) . getId ( ) ) ; } else { return current == null ? org.ovirt.engine.core.compat.Guid.Empty : current ; } }
Source:
public void GetUserNameFromUser ( ) { 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.aaa.DbUser u = new org.ovirt.engine.core.common.businessentities.aaa.DbUser ( ) ; u.setLoginName ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ) ; u.setDomain ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.DOMAIN ) ; b.setCurrentUser ( u ) ; final java.lang.String un = b.getUserName ( ) ; org.junit.Assert.assertEquals ( java.lang.String.format ( "%s[%s]" , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.DOMAIN ) , un ) ; }

Target:
public void GetUserNameFromUser ( ) { 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.aaa.DbUser u = new org.ovirt.engine.core.common.businessentities.aaa.DbUser ( ) ; u.setLoginName ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ) ; u.setDomain ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.DOMAIN ) ; b.setCurrentUser ( u ) ; final java.lang.String un = b.getUserName ( ) ; org.junit.Assert.assertEquals ( java.lang.String.format ( "%s@%s" , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.DOMAIN ) , un ) ; }
Source:
public org.ovirt.engine.ui.common.uicommon.model.SearchableDetailModelProvider < org.ovirt.engine.core.common.businessentities.Erratum , org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel < java.lang.Void > , org.ovirt.engine.ui.uicommonweb.models.VmErrataListModel > getVmErrataListProvider ( com.google.gwt.event.shared.EventBus eventBus , com.google.inject.Provider < org.ovirt.engine.ui.common.presenter.popup.DefaultConfirmationPopupPresenterWidget > defaultConfirmPopupProvider , final com.google.inject.Provider < org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel < java.lang.Void > > mainModelProvider , final com.google.inject.Provider < org.ovirt.engine.ui.uicommonweb.models.VmErrataListModel > modelProvider ) { org.ovirt.engine.ui.common.uicommon.model.SearchableDetailTabModelProvider < org.ovirt.engine.core.common.businessentities.Erratum , org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel < java.lang.Void > , org.ovirt.engine.ui.uicommonweb.models.VmErrataListModel > result = new org.ovirt.engine.ui.common.uicommon.model.SearchableDetailTabModelProvider < org.ovirt.engine.core.common.businessentities.Erratum , org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel < java.lang.Void > , org.ovirt.engine.ui.uicommonweb.models.VmErrataListModel > ( eventBus , defaultConfirmPopupProvider ) ; result.setMainModelProvider ( mainModelProvider ) ; result.setModelProvider ( modelProvider ) ; return result ; }

Target:
public org.ovirt.engine.ui.common.uicommon.model.SearchableDetailModelProvider < org.ovirt.engine.core.common.businessentities.Erratum , org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel < java.lang.Void > , org.ovirt.engine.ui.uicommonweb.models.VmErrataListModel > getVmErrataListProvider ( com.google.gwt.event.shared.EventBus eventBus , com.google.inject.Provider < org.ovirt.engine.ui.common.presenter.popup.DefaultConfirmationPopupPresenterWidget > defaultConfirmPopupProvider , final com.google.inject.Provider < org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel < java.lang.Void > > mainModelProvider , final com.google.inject.Provider < org.ovirt.engine.ui.uicommonweb.models.VmErrataListModel > modelProvider ) { org.ovirt.engine.ui.common.uicommon.model.SearchableDetailTabModelProvider < org.ovirt.engine.core.common.businessentities.Erratum , org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel < java.lang.Void > , org.ovirt.engine.ui.uicommonweb.models.VmErrataListModel > result = new org.ovirt.engine.ui.common.uicommon.model.SearchableDetailTabModelProvider ( eventBus , defaultConfirmPopupProvider ) ; result.setMainModelProvider ( mainModelProvider ) ; result.setModelProvider ( modelProvider ) ; return result ; }
Source:
public void testNoStringSubstitutionWithList ( ) { org.ovirt.engine.core.common.interfaces.ErrorTranslator et = new org.ovirt.engine.core.utils.ErrorTranslatorImpl ( org.ovirt.engine.core.utils.ErrorTranslatorTest.FILENAME ) ; java.util.List < java.lang.String > error = et.translateErrorText ( java.util.Arrays.asList ( org.ovirt.engine.core.utils.ErrorTranslatorTest.TEST_KEY_NO_REPLACEMENT ) ) ; org.junit.Assert.assertTrue ( "Size" , ( ( error.size ( ) ) == 1 ) ) ; org.junit.Assert.assertEquals ( "String should equal" , "VM not found" , error.get ( 0 ) ) ; }

Target:
public void testNoStringSubstitutionWithList ( ) { org.ovirt.engine.core.common.interfaces.ErrorTranslator et = new org.ovirt.engine.core.utils.ErrorTranslatorImpl ( org.ovirt.engine.core.utils.ErrorTranslatorTest.FILENAME ) ; java.util.List < java.lang.String > error = et.translateErrorText ( java.util.Arrays.asList ( org.ovirt.engine.core.utils.ErrorTranslatorTest.TEST_KEY_NO_REPLACEMENT ) ) ; org.junit.Assert.assertEquals ( "Size" , 1 , error.size ( ) ) ; org.junit.Assert.assertEquals ( "String should equal" , "VM not found" , error.get ( 0 ) ) ; }
Source:
public void testGetByIdAll ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity hook = dao.getById ( FixturesTool.HOOK_ID , true ) ; org.junit.Assert.assertNotNull ( hook ) ; org.junit.Assert.assertTrue ( ( ( hook.getServerHooks ( ) . size ( ) ) == 2 ) ) ; org.junit.Assert.assertEquals ( FixturesTool.HOOK_ID , hook.getId ( ) ) ; }

Target:
public void testGetByIdAll ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity hook = dao.getById ( FixturesTool.HOOK_ID , true ) ; org.junit.Assert.assertNotNull ( hook ) ; org.junit.Assert.assertEquals ( 2 , hook.getServerHooks ( ) . size ( ) ) ; org.junit.Assert.assertEquals ( FixturesTool.HOOK_ID , hook.getId ( ) ) ; }
Source:
protected void asyncSearch ( ) { super . asyncSearch ( ) ; org.ovirt.engine.core.common.VdcObjectType objType = getObjectType ( ) ; boolean directOnly = ( objType == ( org.ovirt.engine.core.common.VdcObjectType.VM ) ) ? true : false ; org.ovirt.engine.core.common.queries.GetPermissionsForObjectParameters tempVar = new org.ovirt.engine.core.common.queries.GetPermissionsForObjectParameters ( ) ; tempVar.setObjectId ( getEntityGuid ( ) ) ; tempVar.setVdcObjectType ( objType ) ; tempVar.setDirectOnly ( directOnly ) ; setAsyncResult ( org.ovirt.engine.ui.frontend.Frontend.RegisterQuery ( VdcQueryType.GetPermissionsForObject , tempVar ) ) ; setItems ( getAsyncResult ( ) . getData ( ) ) ; }

Target:
protected void asyncSearch ( ) { super . asyncSearch ( ) ; org.ovirt.engine.core.common.VdcObjectType objType = getObjectType ( ) ; boolean directOnly = ( objType == ( org.ovirt.engine.core.common.VdcObjectType.VM ) ) ? true : false ; org.ovirt.engine.core.common.queries.GetPermissionsForObjectParameters tempVar = new org.ovirt.engine.core.common.queries.GetPermissionsForObjectParameters ( ) ; tempVar.setObjectId ( getEntityGuid ( ) ) ; tempVar.setVdcObjectType ( objType ) ; tempVar.setDirectOnly ( directOnly ) ; setAsyncResult ( null ) ; setItems ( getAsyncResult ( ) . getData ( ) ) ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 , false ) ; setUpEntityQueryExpectations ( 1 , true ) ; setUpVDSGroupExpectations ( GUIDS [ 1 ] ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateNetworkOnCluster , org.ovirt.engine.core.common.action.NetworkClusterParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyUpdate ( resource.update ( getModel ( 0 ) ) , 0 ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 , false , false ) ; setUpEntityQueryExpectations ( 1 , true , true ) ; setUpVDSGroupExpectations ( GUIDS [ 1 ] ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateNetworkOnCluster , org.ovirt.engine.core.common.action.NetworkClusterParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyUpdate ( resource.update ( getModel ( 0 ) ) , 0 ) ; }
Source:
public org.ovirt.engine.core.utils.ovf.xml.XmlNode selectSingleNode ( java.lang.String string , org.ovirt.engine.core.utils.ovf.xml.XmlNamespaceManager _xmlns ) { try { javax.xml.xpath.XPathFactory factory = javax.xml.xpath.XPathFactory.newInstance ( ) ; javax.xml.xpath.XPath xPath = factory.newXPath ( ) ; xPath.setNamespaceContext ( _xmlns ) ; java.lang.Object o = xPath.evaluate ( string , node , javax.xml.xpath.XPathConstants.NODE ) ; if ( o != null ) { return new org.ovirt.engine.core.utils.ovf.xml.XmlNode ( ( ( org.w3c.dom.Node ) ( o ) ) ) ; } return null ; } catch ( javax.xml.xpath.XPathExpressionException e ) { throw new java.lang.RuntimeException ( ( "Failed to evaluate xpath: " + string ) , e ) ; } }

Target:
public org.ovirt.engine.core.utils.ovf.xml.XmlNode selectSingleNode ( java.lang.String string , org.ovirt.engine.core.utils.ovf.xml.XmlNamespaceManager _xmlns ) { try { javax.xml.xpath.XPathFactory factory = javax.xml.xpath.XPathFactory.newInstance ( ) ; javax.xml.xpath.XPath xPath = factory.newXPath ( ) ; xPath.setNamespaceContext ( _xmlns ) ; java.lang.Object o = xPath.evaluate ( string , node , javax.xml.xpath.XPathConstants.NODE ) ; return o != null ? new org.ovirt.engine.core.utils.ovf.xml.XmlNode ( ( ( org.w3c.dom.Node ) ( o ) ) ) : null ; } catch ( javax.xml.xpath.XPathExpressionException e ) { throw new java.lang.RuntimeException ( ( "Failed to evaluate xpath: " + string ) , e ) ; } }
Source:
public void mixedClusterServicesNotSupported ( ) { mockConfigRule.mockConfigValue ( ConfigValues.AllowClusterWithVirtGlusterEnabled , false ) ; org.mockito.Mockito.when ( cluster.supportsGlusterService ( ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( cluster.supportsVirtService ( ) ) . thenReturn ( true ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( clusterDao , dataCenterDao , cluster , cpuFlagsManagerHandler ) ; org.junit.Assert.assertThat ( validator.mixedClusterServicesSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.CLUSTER_ENABLING_BOTH_VIRT_AND_GLUSTER_SERVICES_NOT_ALLOWED ) ) ; }

Target:
public void mixedClusterServicesNotSupported ( ) { mockConfigRule.mockConfigValue ( ConfigValues.AllowClusterWithVirtGlusterEnabled , false ) ; org.mockito.Mockito.when ( cluster.supportsGlusterService ( ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( cluster.supportsVirtService ( ) ) . thenReturn ( true ) ; org.junit.Assert.assertThat ( validator.mixedClusterServicesSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.CLUSTER_ENABLING_BOTH_VIRT_AND_GLUSTER_SERVICES_NOT_ALLOWED ) ) ; }
Source:
public void defaultProperties ( ) { try { java.lang.String basedir = java.lang.System.getProperty ( "basedir" ) ; org.junit.Assume.assumeNotNull ( basedir , "Test isn't run via Maven. Please set the basedir system property" ) ; org.ovirt.engine.core.utils.osinfo.OsinfoPropertiesParser.parse ( java.nio.file.Paths.get ( basedir , "../../../../packaging/conf/osinfo-defaults.properties" ) . toString ( ) ) ; } catch ( java.lang.Exception e ) { java.lang.System.err.println ( "oVirt-engine will fail to load with a broken osinfo properties file." ) ; java.lang.System.err.println ( "Please fix the properties file or osinfo.jj grammar under org.ovirt.engine.core.utils.osinfo." ) ; throw e ; } }

Target:
public void defaultProperties ( ) { java.lang.String basedir = java.lang.System.getProperty ( "basedir" ) ; org.junit.Assume.assumeNotNull ( basedir , "Test isn't run via Maven. Please set the basedir system property" ) ; org.ovirt.engine.core.utils.osinfo.OsinfoPropertiesParser.parse ( java.nio.file.Paths.get ( basedir , "../../../../packaging/conf/osinfo-defaults.properties" ) . toString ( ) ) ; }
Source:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.core.common.businessentities.storage.DiskImage object ) { if ( object.getDiskVmElements ( ) . iterator ( ) . next ( ) . isBoot ( ) ) { return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( constants.bootableDisk ( ) ) ; } return null ; }

Target:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.core.common.businessentities.storage.DiskImage object ) { if ( ( ! ( object.getDiskVmElements ( ) . isEmpty ( ) ) ) && ( object.getDiskVmElements ( ) . iterator ( ) . next ( ) . isBoot ( ) ) ) { return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( constants.bootableDisk ( ) ) ; } return null ; }
Source:
public void succeedWhenStartupTimeoutHasPassed ( ) { java.util.List < java.lang.String > messages = new java.util.LinkedList < > ( ) ; mcr.mockConfigValue ( ConfigValues.DisableFenceAtStartupInSec , 5 ) ; org.mockito.Mockito.when ( backend.getStartedAt ( ) ) . thenReturn ( new org.ovirt.engine.core.compat.DateTime ( ( ( new java.util.Date ( ) . getTime ( ) ) - 20000 ) ) ) ; boolean result = validator.isStartupTimeoutPassed ( messages ) ; org.junit.Assert.assertTrue ( result ) ; }

Target:
public void succeedWhenStartupTimeoutHasPassed ( ) { java.util.List < java.lang.String > messages = new java.util.LinkedList < > ( ) ; org.mockito.Mockito.when ( backend.getStartedAt ( ) ) . thenReturn ( new org.ovirt.engine.core.compat.DateTime ( ( ( new java.util.Date ( ) . getTime ( ) ) - 20000 ) ) ) ; boolean result = validator.isStartupTimeoutPassed ( messages ) ; org.junit.Assert.assertTrue ( result ) ; }
Source:
public void shouldElectActiveDataDomain ( ) { final org.ovirt.engine.core.common.businessentities.StorageDomain domain = prepareStorageDomainForElection ( StorageDomainStatus.Active , "not he domain name" ) ; org.mockito.Mockito.when ( hostedEngineHelper.isHostedEngineStorageDomain ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.StorageDomain.class ) ) ) . thenReturn ( false ) ; org.junit.Assert.assertEquals ( domain , cmd.electNewMaster ( ) ) ; }

Target:
public void shouldElectActiveDataDomain ( ) { final org.ovirt.engine.core.common.businessentities.StorageDomain domain = prepareStorageDomainForElection ( StorageDomainStatus.Active , "not he domain name" , false ) ; org.junit.Assert.assertEquals ( domain , cmd.electNewMaster ( ) ) ; }
Source:
private static java.lang.String serializeParameters ( org.ovirt.engine.core.common.action.VdcActionParametersBase params ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parentParams = params.getParentParameters ( ) ; params.setParentParameters ( null ) ; java.lang.String jsonStr = new org.ovirt.engine.core.utils.serialization.json.JsonObjectSerializer ( ) . serialize ( params ) ; params.setParentParameters ( parentParams ) ; return jsonStr ; }

Target:
private static java.lang.String serializeParameters ( org.ovirt.engine.core.common.action.VdcActionParametersBase params ) { return new org.ovirt.engine.core.utils.serialization.json.JsonObjectSerializer ( ) . serialize ( params ) ; }
Source:
public void onRemove ( ) { org.ovirt.engine.core.common.businessentities.Bookmark selectedBookmark = ( ( org.ovirt.engine.core.common.businessentities.Bookmark ) ( getSelectedItem ( ) ) ) ; org.ovirt.engine.core.common.action.BookmarksParametersBase parameters = new org.ovirt.engine.core.common.action.BookmarksParametersBase ( selectedBookmark.getbookmark_id ( ) ) ; org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback async = new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { postOnSave ( result.getReturnValue ( ) ) ; } } ; getWindow ( ) . startProgress ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.RemoveBookmark , parameters , async ) ; }

Target:
public void onRemove ( ) { org.ovirt.engine.core.common.businessentities.Bookmark selectedBookmark = ( ( org.ovirt.engine.core.common.businessentities.Bookmark ) ( getSelectedItem ( ) ) ) ; org.ovirt.engine.core.common.action.BookmarksParametersBase parameters = new org.ovirt.engine.core.common.action.BookmarksParametersBase ( selectedBookmark.getId ( ) ) ; org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback async = new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { postOnSave ( result.getReturnValue ( ) ) ; } } ; getWindow ( ) . startProgress ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.RemoveBookmark , parameters , async ) ; }
Source:
public static void getGlusterRemoveBricksStatus ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid volumeId , java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricks ) { aQuery.setHandleFailure ( true ) ; org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksQueriesParameters parameters = new org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksQueriesParameters ( clusterId , volumeId , bricks ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeRemoveBricksStatus , parameters , aQuery ) ; }

Target:
public static void getGlusterRemoveBricksStatus ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid volumeId , java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricks ) { aQuery.setHandleFailure ( true ) ; org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksQueriesParameters parameters = new org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksQueriesParameters ( clusterId , volumeId , bricks ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeRemoveBricksStatus , parameters , aQuery ) ; }
Source:
protected org.ovirt.engine.core.bll.ValidationResult validateDisplayType ( ) { org.ovirt.engine.core.common.businessentities.DisplayType selectedDisplayType = ( ( runVmParam.getUseVnc ( ) ) == null ) ? vm.getDefaultDisplayType ( ) : runVmParam.getUseVnc ( ) ? org.ovirt.engine.core.common.businessentities.DisplayType.vnc : org.ovirt.engine.core.common.businessentities.DisplayType.qxl ; if ( ! ( org.ovirt.engine.core.bll.validator.VmValidationUtils.isDisplayTypeSupported ( vm.getOs ( ) , vm.getVdsGroupCompatibilityVersion ( ) , selectedDisplayType ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_ILLEGAL_VM_DISPLAY_TYPE_IS_NOT_SUPPORTED_BY_OS ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
protected org.ovirt.engine.core.bll.ValidationResult validateDisplayType ( ) { if ( ! ( org.ovirt.engine.core.bll.validator.VmValidationUtils.isDisplayTypeSupported ( vm.getOs ( ) , vm.getVdsGroupCompatibilityVersion ( ) , vm.getDefaultDisplayType ( ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_ILLEGAL_VM_DISPLAY_TYPE_IS_NOT_SUPPORTED_BY_OS ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void testAllDomainsHaveSpaceForMergeSuccess ( ) { org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator storageDomainValidator = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator.class ) ; org.mockito.Mockito.doReturn ( storageDomainValidator ) . when ( validator ) . getStorageDomainValidator ( org.mockito.ArgumentMatchers.any ( java.util.Map.Entry.class ) ) ; org.junit.Assert.assertTrue ( validator.allDomainsHaveSpaceForMerge ( org.mockito.ArgumentMatchers.anyList ( ) , org.mockito.ArgumentMatchers.any ( ) ) . isValid ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator , org.mockito.Mockito.times ( org.ovirt.engine.core.bll.validator.storage.MultipleStorageDomainsValidatorTest.NUM_DOMAINS ) ) . hasSpaceForMerge ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; }

Target:
public void testAllDomainsHaveSpaceForMergeSuccess ( ) { org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator storageDomainValidator = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator.class ) ; org.mockito.Mockito.doReturn ( storageDomainValidator ) . when ( validator ) . getStorageDomainValidator ( org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.Assert.assertTrue ( validator.allDomainsHaveSpaceForMerge ( org.mockito.ArgumentMatchers.anyList ( ) , org.mockito.ArgumentMatchers.any ( ) ) . isValid ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator , org.mockito.Mockito.times ( org.ovirt.engine.core.bll.validator.storage.MultipleStorageDomainsValidatorTest.NUM_DOMAINS ) ) . hasSpaceForMerge ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
public static void getClusterList ( 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 ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVdsGroups , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static void getClusterList ( 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 ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVdsGroups , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
protected org.ovirt.engine.api.model.Network getClusterNetwork ( org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid id , java.lang.String name ) { for ( org.ovirt.engine.api.model.Network entity : getBackendCollection ( org.ovirt.engine.api.model.Network.class , VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.VdsGroupQueryParamenters ( clusterId ) ) ) { if ( ( ( id != null ) && ( id.equals ( entity.getId ( ) ) ) ) || ( ( name != null ) && ( name.equals ( entity.getname ( ) ) ) ) ) { return entity ; } } return null ; }

Target:
protected org.ovirt.engine.api.model.Network getClusterNetwork ( org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid id , java.lang.String name ) { for ( org.ovirt.engine.api.model.Network entity : getBackendCollection ( org.ovirt.engine.api.model.Network.class , VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) ) ) { if ( ( ( id != null ) && ( id.equals ( entity.getId ( ) ) ) ) || ( ( name != null ) && ( name.equals ( entity.getName ( ) ) ) ) ) { return entity ; } } return null ; }
Source:
private void addTableFirstRow ( ) { java.util.List < org.gwtbootstrap3.client.ui.Label > values = new java.util.ArrayList < org.gwtbootstrap3.client.ui.Label > ( ) { { add ( createLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.NetworkOutOfSyncPanel.constants.PropertyOutOfSyncPopUp ( ) , true ) ) ; add ( createLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.NetworkOutOfSyncPanel.constants.hostOutOfSyncPopUp ( ) , true ) ) ; add ( createLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.NetworkOutOfSyncPanel.constants.dcOutOfSyncPopUp ( ) , true ) ) ; } } ; addOutOfSyncRow ( values , TextAlign.CENTER ) ; }

Target:
private void addTableFirstRow ( ) { java.util.List < org.gwtbootstrap3.client.ui.Label > values = new java.util.ArrayList < org.gwtbootstrap3.client.ui.Label > ( ) { { add ( createLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.NetworkOutOfSyncPanel.constants.PropertyOutOfSyncPopUp ( ) , true ) ) ; add ( createLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.NetworkOutOfSyncPanel.constants.hostOutOfSyncPopUp ( ) , true ) ) ; add ( createLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.NetworkOutOfSyncPanel.constants.dcOutOfSyncPopUp ( ) , true ) ) ; } } ; addOutOfSyncRow ( values , TextAlign.CENTER , true ) ; }