auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void onRepin ( ) { final org.ovirt.engine.ui.uicommonweb.models.vms.hostdev.RepinHostModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.hostdev.RepinHostModel ) ( getWindow ( ) ) ) ; model.startProgress ( null ) ; pinVmToHost ( model.getPinnedHost ( ) . getSelectedItem ( ) . getId ( ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { model.stopProgress ( ) ; setWindow ( null ) ; } } ) ; }

Target:
private void onRepin ( ) { final org.ovirt.engine.ui.uicommonweb.models.vms.hostdev.RepinHostModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.hostdev.RepinHostModel ) ( getWindow ( ) ) ) ; model.startProgress ( ) ; pinVmToHost ( model.getPinnedHost ( ) . getSelectedItem ( ) . getId ( ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { model.stopProgress ( ) ; setWindow ( null ) ; } } ) ; }
Source:
public void testGetNetworkDiskTypeForV41 ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; diskImage.setStorageTypes ( new java.util.ArrayList ( java.util.Arrays.asList ( StorageType.GLUSTERFS ) ) ) ; org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setClusterCompatibilityVersion ( Version.v4_1 ) ; vm.setClusterId ( org.ovirt.engine.core.vdsbroker.builder.vminfo.VmInfoBuildUtilsTest.CLUSTER_ID ) ; org.mockito.Mockito.doReturn ( getSupportedAdditionalClusterFeatures ( false ) ) . when ( clusterFeatureDao ) . getSupportedFeaturesByClusterId ( org.ovirt.engine.core.vdsbroker.builder.vminfo.VmInfoBuildUtilsTest.CLUSTER_ID ) ; org.junit.Assert.assertEquals ( false , underTest.getNetworkDiskType ( vm , diskImage ) . isPresent ( ) ) ; }

Target:
public void testGetNetworkDiskTypeForV41 ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setClusterCompatibilityVersion ( Version.v4_1 ) ; vm.setClusterId ( org.ovirt.engine.core.vdsbroker.builder.vminfo.VmInfoBuildUtilsTest.CLUSTER_ID ) ; org.mockito.Mockito.doReturn ( getSupportedAdditionalClusterFeatures ( false ) ) . when ( clusterFeatureDao ) . getSupportedFeaturesByClusterId ( org.ovirt.engine.core.vdsbroker.builder.vminfo.VmInfoBuildUtilsTest.CLUSTER_ID ) ; org.junit.Assert.assertEquals ( false , underTest.getNetworkDiskType ( vm , StorageType.GLUSTERFS ) . isPresent ( ) ) ; }
Source:
private void validateAndExpectViolation ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper , org.ovirt.engine.core.common.errors.VdcBllMessages violation ) { java.util.List < java.lang.String > violations = helper.validate ( ) ; org.junit.Assert.assertTrue ( java.text.MessageFormat.format ( "Expected violation {0} but only got {1}." , violation , violations ) , violations.contains ( violation.name ( ) ) ) ; }

Target:
private void validateAndExpectViolation ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper , org.ovirt.engine.core.common.errors.EngineMessage violation ) { java.util.List < java.lang.String > violations = helper.validate ( ) ; org.junit.Assert.assertTrue ( java.text.MessageFormat.format ( "Expected violation {0} but only got {1}." , violation , violations ) , violations.contains ( violation.name ( ) ) ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { org.ovirt.engine.api.restapi.resource.AbstractBackendAssignedTagsResourceTest.assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( org.ovirt.engine.api.restapi.resource.AbstractBackendAssignedTagsResourceTest.queryType , org.ovirt.engine.api.restapi.resource.AbstractBackendAssignedTagsResourceTest.queryParams , new java.lang.String [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendAssignedTagsResourceTest.parentIdName } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendAssignedTagsResourceTest.PARENT_GUID.toString ( ) } , org.ovirt.engine.api.restapi.resource.AbstractBackendAssignedTagsResourceTest.setUpTags ( ) , failure ) ; control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { org.ovirt.engine.api.restapi.resource.AbstractBackendAssignedTagsResourceTest.assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( org.ovirt.engine.api.restapi.resource.AbstractBackendAssignedTagsResourceTest.queryType , org.ovirt.engine.api.restapi.resource.AbstractBackendAssignedTagsResourceTest.queryParams , new java.lang.String [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendAssignedTagsResourceTest.parentIdName } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendAssignedTagsResourceTest.PARENT_GUID.toString ( ) } , org.ovirt.engine.api.restapi.resource.AbstractBackendAssignedTagsResourceTest.setUpTags ( ) , failure ) ; }
Source:
public static void getAAAProfilesList ( 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 ? new java.util.ArrayList < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getAAAProfilesList ( 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 ? new java.util.ArrayList < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
protected org.ovirt.engine.api.model.HostStorage lookupStorage ( java.lang.String id ) { for ( org.ovirt.engine.core.common.businessentities.storage.LUNs lun : getLogicalUnits ( ) ) { if ( lun.getLUN_id ( ) . equals ( id ) ) { return addLinks ( map ( lun ) ) ; } } for ( org.ovirt.engine.api.restapi.resource.StorageDomain vg : getVolumeGroups ( ) ) { if ( vg.getStorage ( ) . equals ( id ) ) { return addLinks ( map ( vg ) ) ; } } return notFound ( ) ; }

Target:
protected org.ovirt.engine.api.model.HostStorage lookupStorage ( java.lang.String id ) { for ( org.ovirt.engine.core.common.businessentities.storage.LUNs lun : getLogicalUnits ( ) ) { if ( lun.getLUN_id ( ) . equals ( id ) ) { return addLinks ( map ( lun ) ) ; } } return notFound ( ) ; }
Source:
public org.ovirt.engine.api.v3.types.V3RngDevice adapt ( org.ovirt.engine.api.model.RngDevice from ) { org.ovirt.engine.api.v3.types.V3RngDevice to = new org.ovirt.engine.api.v3.types.V3RngDevice ( ) ; if ( from.isSetRate ( ) ) { to.setRate ( org.ovirt.engine.api.v3.adapters.V3OutAdapters.adaptOut ( from.getRate ( ) ) ) ; } if ( from.isSetSource ( ) ) { to.setSource ( from.getSource ( ) ) ; } return to ; }

Target:
public org.ovirt.engine.api.v3.types.V3RngDevice adapt ( org.ovirt.engine.api.model.RngDevice from ) { org.ovirt.engine.api.v3.types.V3RngDevice to = new org.ovirt.engine.api.v3.types.V3RngDevice ( ) ; if ( from.isSetRate ( ) ) { to.setRate ( org.ovirt.engine.api.v3.adapters.V3OutAdapters.adaptOut ( from.getRate ( ) ) ) ; } if ( from.isSetSource ( ) ) { to.setSource ( from.getSource ( ) . value ( ) ) ; } return to ; }
Source:
private void validateRngRequiredSource ( ) { org.ovirt.engine.core.compat.Version clusterVersion = getVersion ( ) . getSelectedItem ( ) ; boolean rngSupportedForCluster = isRngSupportedForClusterVersion ( clusterVersion ) ; getRngRandomSourceRequired ( ) . setIsValid ( ( rngSupportedForCluster || ( ! ( getRngRandomSourceRequired ( ) . getEntity ( ) ) ) ) ) ; getRngHwrngSourceRequired ( ) . setIsValid ( ( rngSupportedForCluster || ( ! ( getRngHwrngSourceRequired ( ) . getEntity ( ) ) ) ) ) ; }

Target:
private void validateRngRequiredSource ( ) { getRngRandomSourceRequired ( ) . setIsValid ( true ) ; getRngHwrngSourceRequired ( ) . setIsValid ( true ) ; }
Source:
public static void GetNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.GetAllNetworkQueryParamenters ( dataCenterId ) , aQuery ) ; }

Target:
public static void GetNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage_pool > dataCenters = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.storage_pool > ) ( returnValue ) ) ; for ( org.ovirt.engine.core.common.businessentities.storage_pool dataCenter : dataCenters ) { reportModel.addDataCenterID ( dataCenter.getId ( ) . toString ( ) ) ; } if ( reportModel == null ) { return ; } setWidgetModel ( reportModel ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenters = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ; for ( org.ovirt.engine.core.common.businessentities.StoragePool dataCenter : dataCenters ) { reportModel.addDataCenterID ( dataCenter.getId ( ) . toString ( ) ) ; } if ( reportModel == null ) { return ; } setWidgetModel ( reportModel ) ; }
Source:
public void canDoActionSucceeds ( ) throws java.lang.Exception { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveVdsCommand < org.ovirt.engine.core.common.action.RemoveVdsParameters > ( new org.ovirt.engine.core.common.action.RemoveVdsParameters ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , false ) ) ) ; prepareMocks ( command ) ; mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockVdsDynamic ( ) ; mockVmsPinnedToHost ( java.util.Collections.< java.lang.String > emptyList ( ) ) ; mockIsGlusterEnabled ( false ) ; mockHasVolumeOnServer ( false ) ; runAndAssertCanDoActionSuccess ( ) ; }

Target:
public void canDoActionSucceeds ( ) throws java.lang.Exception { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveVdsCommand < org.ovirt.engine.core.common.action.RemoveVdsParameters > ( new org.ovirt.engine.core.common.action.RemoveVdsParameters ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , false ) ) ) ; prepareMocks ( ) ; mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockVdsDynamic ( ) ; mockVmsPinnedToHost ( java.util.Collections.< java.lang.String > emptyList ( ) ) ; mockIsGlusterEnabled ( false ) ; mockHasVolumeOnServer ( false ) ; runAndAssertCanDoActionSuccess ( ) ; }
Source:
public void freeMacs ( java.util.List < java.lang.String > macs ) { try ( org.ovirt.engine.core.utils.lock.AutoCloseableLock l = new org.ovirt.engine.core.utils.lock.AutoCloseableLock ( lockObj.writeLock ( ) ) ) { checkIfInitialized ( ) ; for ( java.lang.String mac : macs ) { macsStorage.freeMac ( org.ovirt.engine.core.utils.MacAddressRangeUtils.macToLong ( mac ) ) ; } } }

Target:
public void freeMacs ( java.util.List < java.lang.String > macs ) { try ( org.ovirt.engine.core.utils.lock.AutoCloseableLock l = new org.ovirt.engine.core.utils.lock.AutoCloseableLock ( lockObj.writeLock ( ) ) ) { for ( java.lang.String mac : macs ) { macsStorage.freeMac ( org.ovirt.engine.core.utils.MacAddressRangeUtils.macToLong ( mac ) ) ; } } }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.ui.uicommonweb.models.vms.ImportEntityData < E > > entities = ( ( org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.ui.uicommonweb.models.vms.ImportEntityData < E > > ) ( sender ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.ImportEntityData < E > importEntityData = entities.getSelectedItem ( ) ; registerEntityInfoPanel.updateTabsData ( importEntityData ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.ui.uicommonweb.models.vms.ImportEntityData < E > > entities = ( ( org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.ui.uicommonweb.models.vms.ImportEntityData < E > > ) ( sender ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.ImportEntityData < E > importEntityData = entities.getSelectedItem ( ) ; if ( importEntityData != null ) { registerEntityInfoPanel.updateTabsData ( importEntityData ) ; } }
Source:
public boolean isMemorySnapshotSupported ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( vm == null ) { return false ; } boolean archMemorySnapshotSupported = isMemorySnapshotSupportedByArchitecture ( vm.getClusterArch ( ) , vm.getCompatibilityVersion ( ) ) ; return ( ( java.lang.Boolean ) ( getConfigValuePreConverted ( ConfigurationValues.MemorySnapshotSupported , vm.getCompatibilityVersion ( ) . toString ( ) ) ) ) && archMemorySnapshotSupported ; }

Target:
public boolean isMemorySnapshotSupported ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( vm == null ) { return false ; } return isMemorySnapshotSupportedByArchitecture ( vm.getClusterArch ( ) , vm.getCompatibilityVersion ( ) ) ; }
Source:
public void appendCustomValue ( final java.lang.String name , final java.lang.String value , final java.lang.String separator ) { java.util.Objects.requireNonNull ( separator , "It makes no sense having 'null' literal as separator" ) ; final java.lang.String key = name.toLowerCase ( ) ; java.lang.String newValue = value ; allocateCustomValues ( ) ; if ( customValues.containsKey ( key ) ) { newValue = java.lang.String.format ( "%1$s%2$s%3$s" , customValues.get ( key ) , separator , value ) ; } customValues.put ( name.toLowerCase ( ) , newValue ) ; }

Target:
public void appendCustomValue ( final java.lang.String name , final java.lang.String value , final java.lang.String separator ) { final java.lang.String key = name.toLowerCase ( ) ; java.lang.String newValue = value ; allocateCustomValues ( ) ; if ( customValues.containsKey ( key ) ) { newValue = java.lang.String.format ( "%1$s%2$s%3$s" , customValues.get ( key ) , separator , value ) ; } customValues.put ( name.toLowerCase ( ) , newValue ) ; }
Source:
public static void getTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }

Target:
public void getTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmReportedDevicesResourceTest.PARENT_ID } , getEntities ( ) , failure ) ; control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmReportedDevicesResourceTest.PARENT_ID } , getEntities ( ) , failure ) ; }
Source:
public void setUp ( ) { disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; metadataDiskDescriptionHandler = org.mockito.Mockito.spy ( org.ovirt.engine.core.bll.storage.disk.image.MetadataDiskDescriptionHandler.getInstance ( ) ) ; org.mockito.Mockito.doReturn ( auditLogDirector ) . when ( metadataDiskDescriptionHandler ) . getAuditLogDirector ( ) ; org.mockito.Mockito.doNothing ( ) . when ( auditLogDirector ) . log ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.AuditLogType.class ) ) ; }

Target:
public void setUp ( ) { disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; metadataDiskDescriptionHandler = org.mockito.Mockito.spy ( org.ovirt.engine.core.bll.storage.disk.image.MetadataDiskDescriptionHandler.getInstance ( ) ) ; org.mockito.Mockito.doReturn ( auditLogDirector ) . when ( metadataDiskDescriptionHandler ) . getAuditLogDirector ( ) ; }
Source:
public void testQueryWithFilter ( ) throws java.lang.Exception { java.util.List < java.lang.String > filterValue = new java.util.ArrayList < java.lang.String > ( ) ; filterValue.add ( "true" ) ; org.easymock.EasyMock.reset ( httpHeaders ) ; org.easymock.EasyMock.expect ( httpHeaders.getRequestHeader ( "filter" ) ) . andReturn ( filterValue ) ; resource.setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( true , true ) ; control.replay ( ) ; resource.get ( ) ; }

Target:
public void testQueryWithFilter ( ) throws java.lang.Exception { java.util.List < java.lang.String > filterValue = new java.util.ArrayList < java.lang.String > ( ) ; filterValue.add ( "true" ) ; org.easymock.EasyMock.reset ( httpHeaders ) ; org.easymock.EasyMock.expect ( httpHeaders.getRequestHeader ( "filter" ) ) . andReturn ( filterValue ) ; resource.setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; resource.get ( ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.UsbPolicy getUsbPolicyOnCreate ( org.ovirt.engine.api.model.Usb usb , org.ovirt.engine.core.compat.Version vdsGroupVersion ) { if ( ( ( usb == null ) || ( ! ( usb.isSetEnabled ( ) ) ) ) || ( ! ( usb.isEnabled ( ) ) ) ) { return org.ovirt.engine.core.common.businessentities.UsbPolicy.DISABLED ; } else { org.ovirt.engine.api.model.UsbType usbType = org.ovirt.engine.api.restapi.types.VmMapper.getUsbType ( usb ) ; if ( usbType == null ) { return org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyAccordingToClusterVersion ( vdsGroupVersion ) ; } else { return org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyAccordingToUsbType ( usbType ) ; } } }

Target:
public static org.ovirt.engine.core.common.businessentities.UsbPolicy getUsbPolicyOnCreate ( org.ovirt.engine.api.model.Usb usb ) { if ( ( ( usb == null ) || ( ! ( usb.isSetEnabled ( ) ) ) ) || ( ! ( usb.isEnabled ( ) ) ) ) { return org.ovirt.engine.core.common.businessentities.UsbPolicy.DISABLED ; } else { org.ovirt.engine.api.model.UsbType usbType = org.ovirt.engine.api.restapi.types.VmMapper.getUsbType ( usb ) ; if ( usbType == null ) { return null ; } else { return org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyAccordingToUsbType ( usbType ) ; } } }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( operationType ) == null ? 0 : operationType.hashCode ( ) ) ; result = ( prime * result ) + ( ( parameter ) == null ? 0 : parameter.hashCode ( ) ) ; result = ( prime * result ) + ( ( source ) == null ? 0 : source.hashCode ( ) ) ; return result ; }

Target:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( operationType ) == null ? 0 : operationType.hashCode ( ) ) ; result = ( prime * result ) + ( ( parameter ) == null ? 0 : parameter.hashCode ( ) ) ; return result ; }
Source:
protected boolean validateImagesAndVMStates ( ) { return org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVm ( ) , org.ovirt.engine.core.bll.RemoveSnapshotCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVm ( ) . getStoragePoolId ( ) , Guid.Empty , hasImages ( ) , hasImages ( ) , hasImages ( ) , hasImages ( ) , true , true , true , null ) ; }

Target:
protected boolean validateImagesAndVMStates ( ) { return org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVm ( ) , org.ovirt.engine.core.bll.RemoveSnapshotCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVm ( ) . getStoragePoolId ( ) , Guid.Empty , hasImages ( ) , hasImages ( ) , hasImages ( ) , hasImages ( ) , false , true , true , null ) ; }
Source:
public boolean serverExists ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo glusterServer ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = getClusterDao ( ) . get ( org.ovirt.engine.core.bll.gluster.GetAddedGlusterServersQuery.getParameters ( ) . getClusterId ( ) ) ; if ( org.ovirt.engine.core.common.gluster.GlusterFeatureSupported.glusterHostUuidSupported ( cluster.getCompatibilityVersion ( ) ) ) { return getDbUtils ( ) . serverExists ( glusterServer.getUuid ( ) ) ; } else { return getDbUtils ( ) . serverExists ( org.ovirt.engine.core.bll.gluster.GetAddedGlusterServersQuery.getParameters ( ) . getClusterId ( ) , glusterServer.getHostnameOrIp ( ) ) ; } }

Target:
public boolean serverExists ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo glusterServer ) { return getDbUtils ( ) . serverExists ( glusterServer.getUuid ( ) ) ; }
Source:
public void testCompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Vm vm = new org.ovirt.engine.api.model.Vm ( ) ; vm.setName ( "foo" ) ; vm.setStatus ( org.ovirt.engine.api.common.util.StatusUtils.create ( VmStatus.UP ) ) ; vm.setHost ( new org.ovirt.engine.api.model.Host ( ) ) ; org.ovirt.engine.api.common.util.CompletenessAssertor.validateParameters ( vm , "name" , "host" , "status" ) ; }

Target:
public void testCompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Vm vm = new org.ovirt.engine.api.model.Vm ( ) ; vm.setName ( "foo" ) ; vm.setStatus ( VmStatus.UP ) ; vm.setHost ( new org.ovirt.engine.api.model.Host ( ) ) ; org.ovirt.engine.api.common.util.CompletenessAssertor.validateParameters ( vm , "name" , "host" , "status" ) ; }
Source:
public org.ovirt.engine.ui.common.uicommon.model.DetailTabModelProvider < org.ovirt.engine.ui.uicommonweb.models.EngineErrataListModel , org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.Erratum > > getErrataDetailProvider ( final com.google.gwt.event.shared.EventBus eventBus , final com.google.inject.Provider < org.ovirt.engine.ui.common.presenter.popup.DefaultConfirmationPopupPresenterWidget > defaultConfirmPopupProvider , final com.google.inject.Provider < org.ovirt.engine.ui.uicommonweb.models.EngineErrataListModel > mainModelProvider , final com.google.inject.Provider < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.Erratum > > modelProvider ) { org.ovirt.engine.ui.common.uicommon.model.DetailTabModelProvider < org.ovirt.engine.ui.uicommonweb.models.EngineErrataListModel , org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.Erratum > > result = new org.ovirt.engine.ui.common.uicommon.model.DetailTabModelProvider < org.ovirt.engine.ui.uicommonweb.models.EngineErrataListModel , org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.Erratum > > ( eventBus , defaultConfirmPopupProvider ) ; result.setMainModelProvider ( mainModelProvider ) ; result.setModelProvider ( modelProvider ) ; return result ; }

Target:
public org.ovirt.engine.ui.common.uicommon.model.DetailTabModelProvider < org.ovirt.engine.ui.uicommonweb.models.EngineErrataListModel , org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.Erratum > > getErrataDetailProvider ( final com.google.gwt.event.shared.EventBus eventBus , final com.google.inject.Provider < org.ovirt.engine.ui.common.presenter.popup.DefaultConfirmationPopupPresenterWidget > defaultConfirmPopupProvider , final com.google.inject.Provider < org.ovirt.engine.ui.uicommonweb.models.EngineErrataListModel > mainModelProvider , final com.google.inject.Provider < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.Erratum > > modelProvider ) { org.ovirt.engine.ui.common.uicommon.model.DetailTabModelProvider < org.ovirt.engine.ui.uicommonweb.models.EngineErrataListModel , org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.Erratum > > result = new org.ovirt.engine.ui.common.uicommon.model.DetailTabModelProvider ( eventBus , defaultConfirmPopupProvider ) ; result.setMainModelProvider ( mainModelProvider ) ; result.setModelProvider ( modelProvider ) ; return result ; }
Source:
public void testSaveAndGet ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService service = dao.get ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.NEW_SERVICE_ID ) ) ; org.junit.Assert.assertNull ( service ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService newService = insertTestService ( ) ; service = dao.get ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.NEW_SERVICE_ID ) ) ; org.junit.Assert.assertNotNull ( service ) ; org.junit.Assert.assertEquals ( newService , service ) ; }

Target:
public void testSaveAndGet ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService service = dao.get ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.NEW_SERVICE_ID ) ; org.junit.Assert.assertNull ( service ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService newService = insertTestService ( ) ; service = dao.get ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.NEW_SERVICE_ID ) ; org.junit.Assert.assertNotNull ( service ) ; org.junit.Assert.assertEquals ( newService , service ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.GetImagesListQueryBase.getQueryReturnValue ( ) . setReturnValue ( getUserRequestForStorageDomainRepoFileList ( ) ) ; if ( ( org.ovirt.engine.core.bll.GetImagesListQueryBase.getQueryReturnValue ( ) . getReturnValue ( ) ) == null ) { org.ovirt.engine.core.bll.GetImagesListQueryBase.getQueryReturnValue ( ) . setSucceeded ( false ) ; org.ovirt.engine.core.bll.GetImagesListQueryBase.getQueryReturnValue ( ) . setExceptionString ( VdcBllErrors.GetIsoListError.toString ( ) ) ; } }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.GetImagesListQueryBase.getQueryReturnValue ( ) . setReturnValue ( getUserRequestForStorageDomainRepoFileList ( ) ) ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalBasicListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( windowModel instanceof org.ovirt.engine.ui.uicommonweb.models.vms.VncInfoModel ) { return vncInfoPopupProvider.get ( ) ; } else if ( windowModel instanceof org.ovirt.engine.ui.uicommonweb.models.vms.SpiceToGuestWithNonRespAgentModel ) { return spiceToGuestWithNonRespAgentPopupProvider.get ( ) ; } else if ( lastExecutedCommand == ( getModel ( ) . getEditConsoleCommand ( ) ) ) { return consolePopupProvider.get ( ) ; } return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalBasicListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( windowModel instanceof org.ovirt.engine.ui.uicommonweb.models.vms.VncInfoModel ) { return vncInfoPopupProvider.get ( ) ; } else if ( windowModel instanceof org.ovirt.engine.ui.uicommonweb.models.vms.SpiceToGuestWithNonRespAgentModel ) { return spiceToGuestWithNonRespAgentPopupProvider.get ( ) ; } else if ( lastExecutedCommand == ( getModel ( ) . getEditConsoleCommand ( ) ) ) { return consolePopupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }
Source:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 0 , true ) ; control.replay ( ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendBookmarksResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 0 , true ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendBookmarksResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public static void getAllTemplatesFromExportDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , 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 ? source : new java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters getAllFromExportDomainQueryParamenters = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( storagePoolId , storageDomainId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplatesFromExportDomain , getAllFromExportDomainQueryParamenters , aQuery ) ; }

Target:
public void getAllTemplatesFromExportDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , 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 ? source : new java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters getAllFromExportDomainQueryParamenters = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( storagePoolId , storageDomainId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplatesFromExportDomain , getAllFromExportDomainQueryParamenters , aQuery ) ; }
Source:
public void render ( org.ovirt.engine.ui.webadmin.widget.table.column.Context context , org.ovirt.engine.core.common.businessentities.gluster.StorageDevice device , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { if ( device.getCanCreateBrick ( ) ) { return ; } com.google.gwt.resources.client.ImageResource statusImage = null ; java.lang.String tooltip ; statusImage = resources.lockImage ( ) ; tooltip = constants.deviceIsAlreadyUsed ( ) ; com.google.gwt.safehtml.shared.SafeHtml statusImageHtml = com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( statusImage ) . getHTML ( ) ) ; sb.append ( applicationTemplates.statusTemplate ( statusImageHtml , tooltip ) ) ; }

Target:
public void render ( org.ovirt.engine.ui.webadmin.widget.table.column.Context context , org.ovirt.engine.core.common.businessentities.gluster.StorageDevice device , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb , java.lang.String id ) { if ( device.getCanCreateBrick ( ) ) { return ; } com.google.gwt.resources.client.ImageResource statusImage = null ; java.lang.String tooltip ; statusImage = resources.lockImage ( ) ; tooltip = constants.deviceIsAlreadyUsed ( ) ; com.google.gwt.safehtml.shared.SafeHtml statusImageHtml = com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( statusImage ) . getHTML ( ) ) ; sb.append ( applicationTemplates.statusTemplate ( statusImageHtml , tooltip , id ) ) ; }
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 ( ) . getId ( ) ) ; if ( vds != null ) { vds.setCpuName ( org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getCpuFlagsManagerHandler ( ) . 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 ( ) . getId ( ) ) ; if ( vds != null ) { vds.setCpuName ( getCpuFlagsManagerHandler ( ) . findMaxServerCpuByFlags ( vds.getCpuFlags ( ) , vds.getVdsGroupCompatibilityVersion ( ) ) ) ; } org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getQueryReturnValue ( ) . setReturnValue ( vds ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkFilter > networkFilters = new java.util.ArrayList ( ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.network.NetworkFilter > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ) ; networkFilters.add ( org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel.EMPTY_FILTER ) ; getNetworkFilter ( ) . setItems ( networkFilters ) ; initSelectedNetworkFilter ( ) ; }

Target:
public void onSuccess ( java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkFilter > networkFilters = new java.util.ArrayList ( ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.network.NetworkFilter > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ) ; networkFilters.add ( org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel.EMPTY_FILTER ) ; getNetworkFilter ( ) . setItems ( networkFilters ) ; initSelectedNetworkFilter ( ) ; }
Source:
public void setEntity ( java.lang.Object value ) { super . setEntity ( value ) ; if ( getIsToSync ( ) . getIsChangable ( ) ) { if ( ! ( ( java.lang.Boolean ) ( value ) ) ) { revertChanges ( ) ; } setBootProtocolsAvailable ( ( ( java.lang.Boolean ) ( value ) ) ) ; } }

Target:
public void setEntity ( java.lang.Boolean value ) { super . setEntity ( value ) ; if ( getIsToSync ( ) . getIsChangable ( ) ) { if ( ! value ) { revertChanges ( ) ; } setBootProtocolsAvailable ( value ) ; } }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > getStorageDomainsByStoragePoolId ( java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > allDomains , org.ovirt.engine.core.common.businessentities.StorageDomainType type ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > domains = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage_domains s : allDomains ) { org.ovirt.engine.core.common.businessentities.StorageDomainStatus status = s.getstatus ( ) ; if ( ( ( s.getstorage_domain_type ( ) ) == type ) && ( ( ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) == status ) || ( ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Unknown ) == status ) ) ) { domains.add ( s ) ; } } return domains ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > getStorageDomainsByStoragePoolId ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > allDomains , org.ovirt.engine.core.common.businessentities.StorageDomainType type ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain s : allDomains ) { org.ovirt.engine.core.common.businessentities.StorageDomainStatus status = s.getstatus ( ) ; if ( ( ( s.getstorage_domain_type ( ) ) == type ) && ( ( ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) == status ) || ( ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Unknown ) == status ) ) ) { domains.add ( s ) ; } } return domains ; }
Source:
public void testVmWithDisks ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks = new java.util.ArrayList < > ( ) ; disks.add ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateBootSequence ( new org.ovirt.engine.core.common.businessentities.VM ( ) , null , disks , null ) , true , null ) ; }

Target:
public void testVmWithDisks ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks = new java.util.ArrayList < > ( ) ; disks.add ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateBootSequence ( new org.ovirt.engine.core.common.businessentities.VM ( ) , disks , null ) , true , null ) ; }
Source:
protected void updateEntityForRemove ( org.ovirt.engine.core.common.scheduling.ClusterPolicy entity , org.ovirt.engine.core.compat.Guid id ) { if ( ( ( entity.getBalance ( ) ) == null ) || ( ! ( entity.getBalance ( ) . equals ( id ) ) ) ) { return ; } entity.setBalance ( null ) ; }

Target:
private void updateEntityForRemove ( org.ovirt.engine.core.common.scheduling.ClusterPolicy entity , org.ovirt.engine.core.compat.Guid id ) { if ( ( ( entity.getBalance ( ) ) == null ) || ( ! ( entity.getBalance ( ) . equals ( id ) ) ) ) { return ; } entity.setBalance ( null ) ; }
Source:
public void failsInNotImportedAndNotExists ( ) throws java.lang.Exception { org.mockito.Mockito.when ( hostedEngineHelper.getStorageDomain ( ) ) . thenReturn ( null ) ; mockGetExistingDomain ( false ) ; cmd.init ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( "" , cmd , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ; org.mockito.Mockito.verify ( backend , org.mockito.Mockito.times ( 1 ) ) . runInternalQuery ( org.mockito.Matchers.eq ( VdcQueryType.GetExistingStorageDomainList ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class ) ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.times ( 0 ) ) . executeCommand ( ) ; }

Target:
public void failsInNotImportedAndNotExists ( ) throws java.lang.Exception { mockGetExistingDomain ( false ) ; cmd.init ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( "" , cmd , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ; org.mockito.Mockito.verify ( backend , org.mockito.Mockito.times ( 1 ) ) . runInternalQuery ( org.mockito.Matchers.eq ( VdcQueryType.GetExistingStorageDomainList ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class ) ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.times ( 0 ) ) . executeCommand ( ) ; }
Source:
public void setup ( ) { BaseConditionFieldAutoCompleter.tagsHandler = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.interfaces.ITagsHandler.class ) ; org.ovirt.engine.core.common.businessentities.Tags tags = new org.ovirt.engine.core.common.businessentities.Tags ( ) ; tags.setTagName ( org.ovirt.engine.core.searchbackend.SyntaxCheckerTest.TAG_NAME ) ; org.mockito.Mockito.when ( BaseConditionFieldAutoCompleter.tagsHandler.getTagByTagName ( org.mockito.ArgumentMatchers.anyString ( ) ) ) . thenReturn ( tags ) ; org.mockito.Mockito.when ( BaseConditionFieldAutoCompleter.tagsHandler.getTagNamesAndChildrenNamesByRegExp ( org.mockito.ArgumentMatchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.searchbackend.SyntaxCheckerTest.TAG_NAME_WITH_CHILDREN ) ; }

Target:
public void setup ( ) { BaseConditionFieldAutoCompleter.tagsHandler = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.interfaces.ITagsHandler.class ) ; org.ovirt.engine.core.common.businessentities.Tags tags = new org.ovirt.engine.core.common.businessentities.Tags ( ) ; tags.setTagName ( org.ovirt.engine.core.searchbackend.SyntaxCheckerTest.TAG_NAME ) ; org.mockito.Mockito.when ( BaseConditionFieldAutoCompleter.tagsHandler.getTagByTagName ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( tags ) ; org.mockito.Mockito.when ( BaseConditionFieldAutoCompleter.tagsHandler.getTagNamesAndChildrenNamesByRegExp ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( org.ovirt.engine.core.searchbackend.SyntaxCheckerTest.TAG_NAME_WITH_CHILDREN ) ; }
Source:
private void setupParentPopulateExpectations ( boolean notFound ) { org.easymock.EasyMock.expect ( bricksResourceMock.populateAdvancedDetails ( org.easymock.EasyMock.isA ( org.ovirt.engine.api.model.GlusterBrick.class ) , org.easymock.EasyMock.isA ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity.class ) ) ) . andDelegateTo ( new org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterBricksResource ( ) { @ java.lang.Override protected org.ovirt.engine.api.model.GlusterBrick populateAdvancedDetails ( org.ovirt.engine.api.model.GlusterBrick model , org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity entity ) { model.setPort ( GlusterTestHelper.BRICK_PORT ) ; model.setMntOptions ( GlusterTestHelper.BRICK_MNT_OPT ) ; return model ; } } ) . anyTimes ( ) ; }

Target:
private void setupParentPopulateExpectations ( ) { org.easymock.EasyMock.expect ( bricksResourceMock.populateAdvancedDetails ( org.easymock.EasyMock.isA ( org.ovirt.engine.api.model.GlusterBrick.class ) , org.easymock.EasyMock.isA ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity.class ) ) ) . andDelegateTo ( new org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterBricksResource ( ) { @ java.lang.Override protected org.ovirt.engine.api.model.GlusterBrick populateAdvancedDetails ( org.ovirt.engine.api.model.GlusterBrick model , org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity entity ) { model.setPort ( GlusterTestHelper.BRICK_PORT ) ; model.setMntOptions ( GlusterTestHelper.BRICK_MNT_OPT ) ; return model ; } } ) . anyTimes ( ) ; }
Source:
public void save ( org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap map ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "storage_id" , map.getstorage_id ( ) ) . addValue ( "storage_pool_id" , map.getstorage_pool_id ( ) ) . addValue ( "status" , map.getstatus ( ) ) ; getCallsHandler ( ) . executeModification ( "Insertstorage_pool_iso_map" , parameterSource ) ; }

Target:
public void save ( org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap map ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "storage_id" , map.getstorage_id ( ) ) . addValue ( "storage_pool_id" , map.getstorage_pool_id ( ) ) . addValue ( "status" , map.getStatus ( ) ) ; getCallsHandler ( ) . executeModification ( "Insertstorage_pool_iso_map" , parameterSource ) ; }
Source:
public void caluculateNetworkImplementationDetailsNetworkInSyncWithoutQos ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNetworkDevice ( ) ; iface.setQos ( null ) ; calculateNetworkImplementationDetailsAndAssertSync ( iface , true , iface.getNetworkName ( ) , iface.isBridged ( ) , iface.getMtu ( ) , iface.getVlanId ( ) , null ) ; }

Target:
public void caluculateNetworkImplementationDetailsNetworkInSyncWithoutQos ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNetworkDevice ( ) ; iface.setQos ( null ) ; calculateNetworkImplementationDetailsAndAssertSync ( iface , true , iface.isBridged ( ) , iface.getMtu ( ) , iface.getVlanId ( ) , null ) ; }