auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterClusterService swiftService = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterClusterService ) ( returnValue ) ) ; if ( swiftService != null ) { setGlusterSwiftStatus ( swiftService.getStatus ( ) ) ; } else { setGlusterSwiftStatus ( GlusterServiceStatus.UNKNOWN ) ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumeList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > ) ( result ) ) ; int volumesUp = 0 ; int volumesDown = 0 ; for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity : volumeList ) { if ( ( volumeEntity.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus.UP ) ) { volumesUp ++ ; } else { volumesDown ++ ; } } setNoOfVolumesTotal ( volumeList.size ( ) ) ; setNoOfVolumesUp ( volumesUp ) ; setNoOfVolumesDown ( volumesDown ) ; }
Source:
public void testExistingAttachmentIsReusedNoExisting ( ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setNetworkId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertThat ( createNetworkAttachmentValidator ( attachment ) . existingAttachmentIsReused ( java.util.Collections.emptyMap ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testExistingAttachmentIsReusedNoExisting ( ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setNetworkId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.hamcrest.MatcherAssert.assertThat ( createNetworkAttachmentValidator ( attachment ) . existingAttachmentIsReused ( java.util.Collections.emptyMap ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void testGetStorageDomainWithNoStatus ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain result = dao.getStorageDomain ( FixturesTool.STORAGE_POOL_NFS_INACTIVE_ISO , StorageDomainType.ISO , null ) ; org.junit.Assert.assertEquals ( FixturesTool.STORAGE_DOMAIN_NFS_INACTIVE_ISO , result.getId ( ) ) ; org.junit.Assert.assertEquals ( "Wrong committed disk size" , 0 , result.getCommittedDiskSize ( ) ) ; org.junit.Assert.assertEquals ( "Wrong actual disk size" , 0 , result.getActualImagesSize ( ) ) ; }

Target:
public void testGetStorageDomainWithNoStatus ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain result = dao.getStorageDomain ( FixturesTool.STORAGE_POOL_NFS_INACTIVE_ISO , StorageDomainType.ISO , null ) ; org.junit.Assert.assertEquals ( FixturesTool.STORAGE_DOMAIN_NFS_INACTIVE_ISO , result.getId ( ) ) ; org.junit.Assert.assertEquals ( "Wrong committed disk size" , 0 , result.getCommittedDiskSize ( ) ) ; org.junit.Assert.assertEquals ( "Wrong actual disk size" , 0 , result.getActualImagesSize ( ) ) ; org.junit.Assert.assertEquals ( "Wrong shared status" , StorageDomainSharedStatus.Inactive , result.getStorageDomainSharedStatus ( ) ) ; }
Source:
protected void onSelectedItemChanged ( ) { super . onSelectedItemChanged ( ) ; updateActionAvailability ( ) ; getBrickListModel ( ) . setVolumeEntity ( ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity ) ( provideDetailModelEntity ( getSelectedItem ( ) ) ) ) ) ; }

Target:
protected void onSelectedItemChanged ( ) { super . onSelectedItemChanged ( ) ; updateActionAvailability ( ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity selectedVolume = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity ) ( provideDetailModelEntity ( getSelectedItem ( ) ) ) ) ; getBrickListModel ( ) . setVolumeEntity ( selectedVolume ) ; getGeoRepListModel ( ) . setEntity ( selectedVolume ) ; getSnapshotListModel ( ) . setEntity ( selectedVolume ) ; }
Source:
private void initiateResumeUpload ( ) { startProgress ( null ) ; setProgressStr ( "Resuming upload" ) ; final org.ovirt.engine.core.common.action.UploadImageStatusParameters parameters = new org.ovirt.engine.core.common.action.UploadImageStatusParameters ( ) ; parameters.setDiskId ( getDiskModel ( ) . getDisk ( ) . getId ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.UploadImageStatus , parameters , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { initiateResumeUploadCheckStatus ( result ) ; } } , this ) ; }

Target:
private void initiateResumeUpload ( ) { startProgress ( null ) ; setProgressStr ( "Resuming upload" ) ; final org.ovirt.engine.core.common.action.TransferImageStatusParameters parameters = new org.ovirt.engine.core.common.action.TransferImageStatusParameters ( ) ; parameters.setDiskId ( getDiskModel ( ) . getDisk ( ) . getId ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.TransferImageStatus , parameters , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { initiateResumeUploadCheckStatus ( result ) ; } } , this ) ; }
Source:
public void setIsRoleListHidden ( boolean value ) { if ( ( isRoleListHidden ) != value ) { isRoleListHidden = value ; OnPropertyChanged ( new org.ovirt.engine.core.compat.PropertyChangedEventArgs ( "IsRoleListHidden" ) ) ; } if ( ( getIsRoleListHiddenModel ( ) ) != null ) { getIsRoleListHiddenModel ( ) . setEntity ( value ) ; } }

Target:
public void setIsRoleListHidden ( boolean value ) { if ( ( isRoleListHidden ) != value ) { isRoleListHidden = value ; OnPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "IsRoleListHidden" ) ) ; } if ( ( getIsRoleListHiddenModel ( ) ) != null ) { getIsRoleListHiddenModel ( ) . setEntity ( value ) ; } }
Source:
private boolean hasFreeSpace ( org.ovirt.engine.core.common.businessentities.storage_domains storageDomain ) { if ( ( ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) ) ) . getvolume_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.VolumeType.Preallocated ) ) { return org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceChecker.hasSpaceForRequest ( storageDomain , ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) ) ) . getSizeInGigabytes ( ) ) ; } else { return org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceChecker.isBelowThresholds ( storageDomain ) ; } }

Target:
private org.ovirt.engine.core.common.businessentities.DiskImage getDiskImageInfo ( ) { return ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) ) ) ; }
Source:
public static org.ovirt.engine.core.compat.Guid RegisterSearch ( java.lang.String searchString , org.ovirt.engine.core.common.interfaces.SearchType cluster , int searchPageSize , org.ovirt.engine.core.compat.RefObject < org.ovirt.engine.core.compat.ObservableCollection < org.ovirt.engine.core.common.businessentities.IVdcQueryable > > tempRefObject ) { throw new org.ovirt.engine.core.compat.NotImplementedException ( "RegisterSearch is not implemented!" ) ; }

Target:
private static void failureEventHandler ( java.lang.String description , java.util.ArrayList < java.lang.String > errorMessages ) { java.util.ArrayList < org.ovirt.engine.ui.frontend.Message > messages = new java.util.ArrayList < org.ovirt.engine.ui.frontend.Message > ( ) ; for ( java.lang.String errorMessage : errorMessages ) { messages.add ( new org.ovirt.engine.ui.frontend.Message ( description , errorMessage ) ) ; } org.ovirt.engine.ui.frontend.Frontend.frontendFailureEvent.raise ( org.ovirt.engine.ui.frontend.Frontend.class , new org.ovirt.engine.ui.frontend.FrontendFailureEventArgs ( messages ) ) ; }
Source:
protected void init ( org.ovirt.engine.ui.uicommonweb.models.hosts.NicLabelModel model ) { super . init ( model ) ; for ( org.ovirt.engine.ui.uicommonweb.models.ListModel < java.lang.String > labelModel : model.getItems ( ) ) { labelModel.getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override 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 ) { com.google.gwt.event.logical.shared.ValueChangeEvent.fire ( org.ovirt.engine.ui.webadmin.section.main.view.popup.host.VfsNicLabelWidget.this , null ) ; } } ) ; } }

Target:
protected void init ( org.ovirt.engine.ui.uicommonweb.models.hosts.VfsNicLabelModel model ) { super . init ( model ) ; for ( org.ovirt.engine.ui.uicommonweb.models.ListModel < java.lang.String > labelModel : model.getItems ( ) ) { labelModel.getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override 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 ) { com.google.gwt.event.logical.shared.ValueChangeEvent.fire ( org.ovirt.engine.ui.webadmin.section.main.view.popup.host.VfsNicLabelWidget.this , null ) ; } } ) ; } }
Source:
private boolean isRngDeviceSupported ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { org.ovirt.engine.core.compat.Version clusterVersion = clusterVersionOrNull ( model ) ; return clusterVersion == null ? false : ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.VirtIoRngDeviceSupported , clusterVersion.getValue ( ) ) ) ) ; }

Target:
private boolean isRngDeviceSupported ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { org.ovirt.engine.core.compat.Version clusterVersion = model.getCompatibilityVersion ( ) ; return clusterVersion == null ? false : ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.VirtIoRngDeviceSupported , clusterVersion.getValue ( ) ) ) ) ; }
Source:
java.io.File getFile ( final java.io.File brandingRootPath , final java.lang.String path ) { java.io.File result = null ; java.lang.String mergedPath = new java.io.File ( brandingRootPath.getAbsolutePath ( ) , ( path == null ? "" : path ) ) . getAbsolutePath ( ) ; if ( ( path != null ) && ( org.ovirt.engine.core.utils.servlet.ServletUtils.isSane ( mergedPath ) ) ) { result = new java.io.File ( mergedPath ) ; } else { org.ovirt.engine.core.branding.BrandingServlet.log.error ( ( ( "The path \"" + mergedPath ) + "\" is not sane" ) ) ; } return result ; }

Target:
java.io.File getFile ( final java.io.File brandingRootPath , final java.lang.String path ) { java.io.File result = null ; java.lang.String mergedPath = new java.io.File ( brandingRootPath.getAbsolutePath ( ) , ( path == null ? "" : path ) ) . getAbsolutePath ( ) ; if ( ( path != null ) && ( org.ovirt.engine.core.utils.servlet.ServletUtils.isSane ( mergedPath ) ) ) { result = new java.io.File ( mergedPath ) ; } else { org.ovirt.engine.core.branding.BrandingServlet.log.error ( "The path '{}' is not sane" , mergedPath ) ; } return result ; }
Source:
public void getEligibleVolumes ( ) { this . startProgress ( constants.fetchingDataMessage ( ) ) ; org.ovirt.engine.ui.uicommonweb.models.gluster.AsyncQuery aQuery = new org.ovirt.engine.ui.uicommonweb.models.gluster.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object returnValue ) { showAvailableVolumes ( returnValue ) ; } } ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterGeoReplicationEligibleVolumes , new org.ovirt.engine.core.common.queries.IdQueryParameters ( masterVolume.getId ( ) ) , aQuery ) ; }

Target:
public void getEligibleVolumes ( ) { this . startProgress ( constants.fetchingDataMessage ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterGeoReplicationEligibleVolumes , new org.ovirt.engine.core.common.queries.IdQueryParameters ( masterVolume.getId ( ) ) , new org.ovirt.engine.ui.uicommonweb.models.gluster.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < org.ovirt.engine.core.common.queries.VdcQueryReturnValue > ( ) { @ java.lang.Override public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { showAvailableVolumes ( returnValue ) ; } } ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { setProfileEntries ( ( ( java.util.List < org.ovirt.engine.core.aaa.ProfileEntry > ) ( result ) ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getAAANamespaces ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object result ) { namespacesMap = ( ( java.util.HashMap < java.lang.String , java.util.List < java.lang.String > > ) ( result ) ) ; populateProfiles ( getProfileEntries ( ) ) ; } } ) ) ; }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.aaa.ProfileEntry > result ) { setProfileEntries ( result ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getAAANamespaces ( new org.ovirt.engine.ui.uicommonweb.models.users.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < java.util.Map < java.lang.String , java.util.List < java.lang.String > > > ( ) { @ java.lang.Override public void onSuccess ( java.util.Map < java.lang.String , java.util.List < java.lang.String > > result ) { namespacesMap = result ; populateProfiles ( getProfileEntries ( ) ) ; } } ) ) ; }
Source:
protected boolean ValidateAdd ( org.ovirt.engine.core.common.EventNotificationMethod eventNotificationMethod , org.ovirt.engine.core.common.businessentities.EventSubscriber eventSubscriber , org.ovirt.engine.core.common.businessentities.aaa.DbUser user ) { java.lang.String tagName = eventSubscriber.getTagName ( ) ; boolean retValue = ValidateNotificationMethod ( eventNotificationMethod , eventSubscriber , user ) ; if ( retValue && ( org.apache.commons.lang.StringUtils.isNotEmpty ( tagName ) ) ) { retValue = ValidateTag ( tagName ) ; } return retValue ; }

Target:
protected boolean validateAdd ( org.ovirt.engine.core.common.EventNotificationMethod eventNotificationMethod , org.ovirt.engine.core.common.businessentities.EventSubscriber eventSubscriber , org.ovirt.engine.core.common.businessentities.aaa.DbUser user ) { java.lang.String tagName = eventSubscriber.getTagName ( ) ; boolean retValue = validateNotificationMethod ( eventNotificationMethod , eventSubscriber , user ) ; if ( retValue && ( org.apache.commons.lang.StringUtils.isNotEmpty ( tagName ) ) ) { retValue = validateTag ( tagName ) ; } return retValue ; }
Source:
public void render ( org.ovirt.engine.ui.webadmin.widget.table.cell.Context context , T value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { if ( ! ( isVisible ( value ) ) ) { return ; } sb.appendHtmlConstant ( "<table style=\"margin:0 auto\"><tr>" ) ; java.util.Iterator < com.google.gwt.cell.client.HasCell < T , ? > > iterator = hasCells.iterator ( ) ; while ( iterator.hasNext ( ) ) { render ( context , value , sb , iterator.next ( ) ) ; } sb.appendHtmlConstant ( "</tr></table>" ) ; }

Target:
public void render ( org.ovirt.engine.ui.webadmin.widget.table.cell.Context context , T value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb , java.lang.String id ) { if ( ! ( isVisible ( value ) ) ) { return ; } sb.appendHtmlConstant ( ( ( "<table id=\"" + id ) + "\" style=\"margin:0 auto\"><tr>" ) ) ; java.util.Iterator < com.google.gwt.cell.client.HasCell < T , ? > > iterator = hasCells.iterator ( ) ; while ( iterator.hasNext ( ) ) { render ( context , value , sb , iterator.next ( ) , id ) ; } sb.appendHtmlConstant ( "</tr></table>" ) ; }
Source:
private static void flatGroups ( java.util.List < org.ovirt.engine.api.extensions.ExtMap > accumulator , java.util.List < org.ovirt.engine.api.extensions.ExtMap > groupsFrom ) { for ( org.ovirt.engine.api.extensions.ExtMap group : groupsFrom ) { org.ovirt.engine.core.aaa.DirectoryUtils.flatGroups ( accumulator , group.get ( GroupRecord.GROUPS , java.util.Collections.< org.ovirt.engine.api.extensions.ExtMap > emptyList ( ) ) ) ; accumulator.add ( group ) ; } }

Target:
private static java.util.List < org.ovirt.engine.api.extensions.ExtMap > flatGroups ( org.ovirt.engine.api.extensions.ExtMap entity , org.ovirt.engine.api.extensions.ExtKey key , java.util.List < org.ovirt.engine.api.extensions.ExtMap > accumulator ) { for ( org.ovirt.engine.api.extensions.ExtMap group : entity.get ( key , java.util.Collections.< org.ovirt.engine.api.extensions.ExtMap > emptyList ( ) ) ) { accumulator.add ( group ) ; org.ovirt.engine.core.aaa.DirectoryUtils.flatGroups ( group , GroupRecord.GROUPS , accumulator ) ; } return accumulator ; }
Source:
public void testGetStorageDomainIdWithPermissions ( ) { mockStoragePoolDAO ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; org.ovirt.engine.core.dao.StorageDomainDAO storageDomainDAOMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StorageDomainDAO.class ) ; org.mockito.Mockito.when ( storageDomainDAOMock.getIsoStorageDomainIdForPool ( getQueryParameters ( ) . getStoragePoolId ( ) , StorageDomainStatus.Active ) ) . thenReturn ( storageDomainId ) ; org.mockito.Mockito.when ( getQuery ( ) . getDbFacade ( ) . getStorageDomainDao ( ) ) . thenReturn ( storageDomainDAOMock ) ; org.junit.Assert.assertEquals ( "wrong storage domain id" , storageDomainId , getQuery ( ) . getStorageDomainIdForQuery ( ) ) ; }

Target:
public void testGetStorageDomainIdWithPermissions ( ) { mockStoragePoolDao ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; org.ovirt.engine.core.dao.StorageDomainDao storageDomainDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StorageDomainDao.class ) ; org.mockito.Mockito.when ( storageDomainDaoMock.getIsoStorageDomainIdForPool ( getQueryParameters ( ) . getStoragePoolId ( ) , StorageDomainStatus.Active ) ) . thenReturn ( storageDomainId ) ; org.mockito.Mockito.when ( getQuery ( ) . getDbFacade ( ) . getStorageDomainDao ( ) ) . thenReturn ( storageDomainDaoMock ) ; org.junit.Assert.assertEquals ( "wrong storage domain id" , storageDomainId , getQuery ( ) . getStorageDomainIdForQuery ( ) ) ; }
Source:
public static void getGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }

Target:
public static void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }
Source:
public void testParseInvalidOption ( ) { java.util.List < org.ovirt.engine.api.model.Agent > ret = org.ovirt.engine.api.restapi.util.FenceOptionsParser.parse ( "foo:one=1,two=2,three" , "one=bool,two=int,three=bool" ) ; assertNotNull ( ret ) ; assertEquals ( 1 , ret.size ( ) ) ; verifyResult ( ret.get ( 0 ) , "foo" , "one" , "bool" , "1" , "two" , "int" , "2" ) ; }

Target:
public void testParseMissingType ( ) { java.util.List < org.ovirt.engine.api.model.Agent > ret = org.ovirt.engine.api.restapi.util.FenceOptionsParser.parse ( "foo:one=1" , "two=int" ) ; org.junit.Assert.assertNotNull ( ret ) ; org.junit.Assert.assertEquals ( 1 , ret.size ( ) ) ; verifyResult ( ret.get ( 0 ) , "foo" ) ; }
Source:
private void assertHostsListMatch ( java.util.List < org.ovirt.engine.api.model.Host > modelHostsList , java.util.List < org.ovirt.engine.api.model.Host > trnsfHostsList ) { for ( org.ovirt.engine.api.model.Host host : modelHostsList ) { boolean foundInTransformation = false ; for ( org.ovirt.engine.api.model.Host otherHost : trnsfHostsList ) { if ( host.getId ( ) . equals ( otherHost.getId ( ) ) ) { foundInTransformation = true ; break ; } } assertTrue ( "Umatching dedicated host in Placement Policy" , foundInTransformation ) ; } }

Target:
private void assertHostsListMatch ( java.util.List < org.ovirt.engine.api.model.Host > modelHostsList , java.util.List < org.ovirt.engine.api.model.Host > trnsfHostsList ) { for ( org.ovirt.engine.api.model.Host host : modelHostsList ) { boolean foundInTransformation = false ; for ( org.ovirt.engine.api.model.Host otherHost : trnsfHostsList ) { if ( host.getId ( ) . equals ( otherHost.getId ( ) ) ) { foundInTransformation = true ; break ; } } org.junit.Assert.assertTrue ( "Umatching dedicated host in Placement Policy" , foundInTransformation ) ; } }
Source:
public void notHostedEngineVM ( ) { vm.setOrigin ( OriginType.OVIRT ) ; org.assertj.core.api.Assertions.assertThatThrownBy ( ( ) -> new org.ovirt.engine.core.utils.ovf.HostedEngineOvfWriter ( vm , fullEntityOvfData , version , emulatedMachine , cpuId , osRepository ) ) . isInstanceOf ( java.lang.IllegalArgumentException.class ) . hasMessageContaining ( "Hosted Engine" ) ; }

Target:
public void notHostedEngineVM ( ) { vm.setOrigin ( OriginType.OVIRT ) ; org.assertj.core.api.Assertions.assertThatThrownBy ( ( ) -> new org.ovirt.engine.core.utils.ovf.HostedEngineOvfWriter ( vm , fullEntityOvfData , version , emulatedMachine , cpuId , osRepository , engineXml ) ) . isInstanceOf ( java.lang.IllegalArgumentException.class ) . hasMessageContaining ( "Hosted Engine" ) ; }
Source:
protected boolean checkImageConfiguration ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage ) { return org.ovirt.engine.core.bll.ImagesHandler.CheckImageConfiguration ( destStorages.get ( diskInfoDestinationMap.get ( diskImage.getId ( ) ) . getstorage_ids ( ) . get ( 0 ) ) . getStorageStaticData ( ) , diskImage , org.ovirt.engine.core.bll.AddVmFromSnapshotCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }

Target:
protected boolean checkImageConfiguration ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage ) { return org.ovirt.engine.core.bll.ImagesHandler.CheckImageConfiguration ( destStorages.get ( diskInfoDestinationMap.get ( diskImage.getId ( ) ) . getStorageIds ( ) . get ( 0 ) ) . getStorageStaticData ( ) , diskImage , org.ovirt.engine.core.bll.AddVmFromSnapshotCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }
Source:
private boolean isSysprepUsed ( org.ovirt.engine.core.common.businessentities.VM vm ) { return ( ( ( vm.getInitializationType ( ) ) == ( org.ovirt.engine.core.common.businessentities.InitializationType.Sysprep ) ) && ( org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . get ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) . isWindows ( vm.getVmOsId ( ) ) ) ) && ( ( ( vm.getFloppyPath ( ) ) == null ) || ( "" . equals ( vm.getFloppyPath ( ) ) ) ) ; }

Target:
private void init ( ) { this . windows = org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . get ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) . isWindows ( vm.getVmOsId ( ) ) ; }
Source:
public void testSimple ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.Label red = new org.ovirt.engine.core.common.businessentities.LabelBuilder ( ) . entities ( vm , host1 ) . build ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Label > labels = java.util.Arrays.asList ( red ) ; org.mockito.Mockito.doReturn ( labels ) . when ( labelDao ) . getAllByEntityIds ( org.mockito.Matchers.any ( ) ) ; org.assertj.core.api.Assertions.assertThat ( unit.filter ( cluster , hosts , vm , new java.util.HashMap < > ( ) , new org.ovirt.engine.core.common.scheduling.PerHostMessages ( ) ) ) . contains ( host1 ) . doesNotContain ( host2 ) ; }

Target:
public void testSimple ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.Label red = new org.ovirt.engine.core.common.businessentities.LabelBuilder ( ) . entities ( vm , host1 ) . build ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Label > labels = java.util.Collections.singletonList ( red ) ; org.mockito.Mockito.doReturn ( labels ) . when ( labelDao ) . getAllByEntityIds ( org.mockito.Matchers.any ( ) ) ; org.assertj.core.api.Assertions.assertThat ( unit.filter ( cluster , hosts , vm , new java.util.HashMap < > ( ) , new org.ovirt.engine.core.common.scheduling.PerHostMessages ( ) ) ) . contains ( host1 ) . doesNotContain ( host2 ) ; }
Source:
protected boolean checkImagesStatus ( ) { return org.ovirt.engine.core.bll.ImagesHandler.checkImagesLocked ( org.ovirt.engine.core.bll.lsm.LiveMigrateVmDisksCommand.getVmId ( ) , org.ovirt.engine.core.bll.lsm.LiveMigrateVmDisksCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }

Target:
protected boolean checkImagesStatus ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksToCheck = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.lsm.LiveMigrateVmDisksCommand.getVmId ( ) ) , true , false ) ; org.ovirt.engine.core.bll.validator.DiskImagesValidator diskImagesValidator = new org.ovirt.engine.core.bll.validator.DiskImagesValidator ( disksToCheck ) ; return validate ( diskImagesValidator.diskImagesNotLocked ( ) ) ; }
Source:
public void testCleanExpiredUsersSessionsWithUsers ( ) { initDataForClearTest ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER ) ; container.cleanExpiredUsersSessions ( ) ; container.cleanExpiredUsersSessions ( ) ; org.junit.Assert.assertNull ( "Get should return null since the session was removed" , container.GetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER , false ) ) ; org.junit.Assert.assertNull ( "Get should return null since the session was removed" , container.getUser ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , false ) ) ; }

Target:
public void testCleanExpiredUsersSessionsWithUsers ( ) { initDataForClearTest ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER ) ; container.cleanExpiredUsersSessions ( ) ; container.cleanExpiredUsersSessions ( ) ; org.junit.Assert.assertNull ( "Get should return null since the session was removed" , container.getData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER , false ) ) ; org.junit.Assert.assertNull ( "Get should return null since the session was removed" , container.getUser ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , false ) ) ; }
Source:
public void canDoActionThinProvisioningSpaceCheckSucceeds ( ) throws java.lang.Exception { final int availableSize = 6 ; final int usedSize = 4 ; org.ovirt.engine.core.compat.Guid sdid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( sdid , VolumeType.Sparse ) ; mockVm ( ) ; mockStorageDomain ( sdid , availableSize , usedSize ) ; mockStoragePoolIsoMap ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; }

Target:
public void canDoActionSucceedsOnDiskDomainCheckWhenStorageGuidInParamsMatches ( ) throws java.lang.Exception { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( storageId ) ; mockVmWithDisk ( storageId ) ; mockStorageDomain ( storageId ) ; mockStoragePoolIsoMap ( ) ; mockInterfaceList ( ) ; mockMaxPciSlots ( ) ; runAndAssertCanDoActionSuccess ( ) ; }
Source:
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.storage.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 getVmNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { 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.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.StorageServerConnections getConnection ( org.ovirt.engine.core.common.businessentities.StorageType storageType , java.lang.String address , java.lang.String target , java.lang.String userName , java.lang.String password , java.lang.Integer port ) { return new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( address , null , target , password , storageType , userName , ( port == null ? null : java.lang.Integer.toString ( port ) ) , "0" ) ; }

Target:
public static org.ovirt.engine.core.common.businessentities.StorageServerConnections getConnection ( org.ovirt.engine.core.common.businessentities.StorageType storageType , java.lang.String address , java.lang.String target , java.lang.String userName , java.lang.String password , java.lang.Integer port ) { return new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( address , null , target , password , storageType , userName , ( port == null ? null : java.lang.Integer.toString ( port ) ) , org.ovirt.engine.core.common.businessentities.StorageServerConnections.DEFAULT_TPGT ) ; }
Source:
public void isTemplateNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }

Target:
public void getIsGlusterVolumeSnapshotCliScheduleEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeSnapshotCliScheduleFlag , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
public boolean isManagementNetwork ( org.ovirt.engine.core.compat.Guid networkId , org.ovirt.engine.core.compat.Guid clusterId ) { final org.ovirt.engine.core.common.businessentities.network.NetworkCluster networkCluster = getNetworkClusterDao ( ) . get ( new org.ovirt.engine.core.common.businessentities.network.NetworkClusterId ( clusterId , networkId ) ) ; return ( networkCluster != null ) && ( networkCluster.isManagement ( ) ) ; }

Target:
public boolean isManagementNetwork ( org.ovirt.engine.core.compat.Guid networkId ) { final java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkCluster > networkClusters = networkClusterDao.getAllForNetwork ( networkId ) ; final org.ovirt.engine.core.common.businessentities.network.NetworkCluster managementNetworkCluster = org.ovirt.engine.core.utils.linq.LinqUtils.firstOrNull ( networkClusters , new org.ovirt.engine.core.utils.linq.Predicate < org.ovirt.engine.core.common.businessentities.network.NetworkCluster > ( ) { @ java.lang.Override public boolean eval ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster networkCluster ) { return networkCluster.isManagement ( ) ; } } ) ; return managementNetworkCluster != null ; }
Source:
protected boolean isInterfaceSupportedForPlugUnPlug ( org.ovirt.engine.core.common.businessentities.Disk disk ) { if ( ! ( ( DiskInterface.VirtIO.equals ( disk.getDiskInterface ( ) ) ) || ( DiskInterface.VirtIO_SCSI.equals ( disk.getDiskInterface ( ) ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.HOT_PLUG_DISK_IS_NOT_VIRTIO ) ; return false ; } return true ; }

Target:
protected boolean isInterfaceSupportedForPlugUnPlug ( org.ovirt.engine.core.common.businessentities.Disk disk ) { java.util.Set < java.lang.String > diskHotpluggableInterfaces = osRepository.getDiskHotpluggableInterfaces ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getOs ( ) , org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getVdsGroupCompatibilityVersion ( ) ) ; if ( ( org.springframework.util.CollectionUtils.isEmpty ( diskHotpluggableInterfaces ) ) || ( ! ( diskHotpluggableInterfaces.contains ( disk.getDiskInterface ( ) . toString ( ) ) ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED ) ; } return true ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterGeoRepKeysUpdate ( java.util.List < java.lang.String > geoRepPubKeys , java.lang.String remoteUserName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Gluster.writeGeoRepPubKeys" ) . withParameter ( "geoRepPubKeys" , geoRepPubKeys ) . withOptionalParameter ( "userName" , remoteUserName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterGeoRepKeysUpdate ( java.util.List < java.lang.String > geoRepPubKeys , java.lang.String remoteUserName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepKeysUpdate" ) . withParameter ( "geoRepPubKeys" , geoRepPubKeys ) . withOptionalParameter ( "userName" , remoteUserName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }
Source:
static org.ovirt.engine.api.model.Network setUpEntityExpectations ( org.ovirt.engine.api.model.Network entity , boolean isDisplay , int index ) { org.easymock.classextension.EasyMock.expect ( entity.getis_display ( ) ) . andReturn ( isDisplay ) . anyTimes ( ) ; return org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.setUpEntityExpectations ( entity , index ) ; }

Target:
static org.ovirt.engine.api.model.Network setUpEntityExpectations ( org.ovirt.engine.api.model.Network entity , boolean isDisplay , boolean isRequired , int index ) { org.easymock.classextension.EasyMock.expect ( entity.getis_display ( ) ) . andReturn ( isDisplay ) . anyTimes ( ) ; org.easymock.classextension.EasyMock.expect ( entity.isRequired ( ) ) . andReturn ( isRequired ) . anyTimes ( ) ; return org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.setUpEntityExpectations ( entity , index ) ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.compat.Guid > getGuidListFromString ( java.lang.String str ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( str ) ) { return new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ; } return org.ovirt.engine.core.utils.GuidUtils.getGuidListFromStringArray ( java.util.Arrays.asList ( org.ovirt.engine.core.utils.GuidUtils.GUID_LIST_PATTERN.split ( str ) ) ) ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.core.compat.Guid > getGuidListFromString ( java.lang.String str ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( str ) ) { return new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ; } return org.ovirt.engine.core.utils.GuidUtils.getGuidListFromStringArray ( java.util.Arrays.asList ( str.split ( org.ovirt.engine.core.utils.GuidUtils.SEPARATOR ) ) ) ; }
Source:
private void dataCenterWithClusterSelectedItemChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { behavior.dataCenterWithClusterSelectedItemChanged ( ) ; org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster dataCenterWithCluster = getDataCenterWithClustersList ( ) . getSelectedItem ( ) ; if ( ( dataCenterWithCluster != null ) && ( ( dataCenterWithCluster.getDataCenter ( ) ) != null ) ) { getDisksAllocationModel ( ) . setQuotaEnforcementType ( dataCenterWithCluster.getDataCenter ( ) . getQuotaEnforcementType ( ) ) ; } updateMaximalVmMemSize ( ) ; handleQxlClusterLevel ( ) ; }

Target:
private void dataCenterWithClusterSelectedItemChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { behavior.dataCenterWithClusterSelectedItemChanged ( ) ; org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster dataCenterWithCluster = getDataCenterWithClustersList ( ) . getSelectedItem ( ) ; if ( ( dataCenterWithCluster != null ) && ( ( dataCenterWithCluster.getDataCenter ( ) ) != null ) ) { getDisksAllocationModel ( ) . setQuotaEnforcementType ( dataCenterWithCluster.getDataCenter ( ) . getQuotaEnforcementType ( ) ) ; } updateMigrationOptions ( ) ; handleQxlClusterLevel ( ) ; updateWatchdogModels ( ) ; updateBootMenu ( ) ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVds , org.ovirt.engine.core.common.action.UpdateVdsActionParameters.class , new java.lang.String [ ] { "RootPassword" } , new java.lang.Object [ ] { "" } , true , true ) ) ; verifyModel ( resource.update ( org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.getModel ( 0 ) ) , 0 ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVds , org.ovirt.engine.core.common.action.UpdateVdsActionParameters.class , new java.lang.String [ ] { "RootPassword" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostResourceTest.ROOT_PASSWORD } , true , true ) ) ; verifyModel ( resource.update ( org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.getModel ( 0 ) ) , 0 ) ; }
Source:
public void testCanEditARunningVM ( ) { prepareVmToPassCanDoAction ( ) ; vm.setStatus ( VMStatus.Up ) ; mockDiskDaoGetAllForVm ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.Disk > emptyList ( ) , true ) ; org.mockito.Mockito.doReturn ( vmDeviceDAO ) . when ( command ) . getVmDeviceDao ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . areUpdatedFieldsLegal ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
public void testCanEditARunningVM ( ) { prepareVmToPassCanDoAction ( ) ; vm.setStatus ( VMStatus.Up ) ; mockDiskDaoGetAllForVm ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.storage.Disk > emptyList ( ) , true ) ; mockVmValidator ( ) ; org.mockito.Mockito.doReturn ( vmDeviceDAO ) . when ( command ) . getVmDeviceDao ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . areUpdatedFieldsLegal ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }
Source:
public org.ovirt.engine.sdk.decorators.VMDisk update ( java.lang.String correlationId ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . add ( "Correlation-Id" , correlationId ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . update ( url , this , org.ovirt.engine.sdk.entities.Disk.class , org.ovirt.engine.sdk.decorators.VMDisk.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.decorators.VMDisk update ( ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; url = urlBuilder.build ( ) ; return getProxy ( ) . update ( url , this , org.ovirt.engine.sdk.entities.Disk.class , org.ovirt.engine.sdk.decorators.VMDisk.class , headers ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult networkAttachedToCluster ( ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.NETWORK_NOT_EXISTS_IN_CLUSTER ) . when ( ( ( getNetworkCluster ( ) ) == null ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult networkAttachedToCluster ( ) { org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_OF_GIVEN_NAME_NOT_EXISTS_IN_CLUSTER ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( engineMessage , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( engineMessage , this . attachment.getNetworkName ( ) ) ) . when ( ( ( getNetworkCluster ( ) ) == null ) ) ; }
Source:
public java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > RunMultipleActions ( org.ovirt.engine.core.common.action.VdcActionType actionType , java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters ) { return runMultipleActionsImpl ( actionType , parameters , false ) ; }

Target:
public java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > runMultipleActions ( org.ovirt.engine.core.common.action.VdcActionType actionType , java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , boolean isRunOnlyIfAllCanDoPass , boolean waitForResult ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = notAllowToRunAction ( actionType ) ; if ( returnValue != null ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > list = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > ( ) ; list.add ( returnValue ) ; return list ; } else { return runMultipleActionsImpl ( actionType , parameters , false , isRunOnlyIfAllCanDoPass , waitForResult ) ; } }
Source:
public void save ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment entity ) { verifyRelationWithHostNetworkQos ( entity ) ; verifyUnsetStoragePoolIdAndNameOnQos ( entity ) ; super . save ( entity ) ; hostNetworkQosDao.save ( entity.getHostNetworkQos ( ) ) ; }

Target:
public void removeByNetworkId ( org.ovirt.engine.core.compat.Guid networkId ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > networkAttachments = getAllForNetwork ( networkId ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment : networkAttachments ) { hostNetworkQosDao.remove ( networkAttachment.getId ( ) ) ; } getCallsHandler ( ) . executeModification ( "RemoveNetworkAttachmentByNetworkId" , createIdParameterMapper ( networkId ) ) ; }
Source:
org.ovirt.engine.core.bll.ValidationResult validateNotRemovingUsedNetworkByVms ( ) { java.util.Collection < java.lang.String > removedNetworks = new java.util.HashSet < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment removedAttachment : removedNetworkAttachments ) { removedNetworks.add ( existingNetworkRelatedToAttachment ( removedAttachment ) . getName ( ) ) ; } java.util.List < java.lang.String > vmNames = getVmInterfaceManager ( ) . findActiveVmsUsingNetworks ( host.getId ( ) , removedNetworks ) ; if ( vmNames.isEmpty ( ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } else { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_CANNOT_DETACH_NETWORK_USED_BY_VMS , org.ovirt.engine.core.utils.ReplacementUtils.replaceWith ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator.VAR_NETWORK_CANNOT_DETACH_NETWORK_USED_BY_VMS_LIST , vmNames ) ) ; } }

Target:
org.ovirt.engine.core.bll.ValidationResult validateNotRemovingUsedNetworkByVms ( ) { java.util.Collection < java.lang.String > removedNetworks = new java.util.HashSet < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment removedAttachment : removedNetworkAttachments ) { removedNetworks.add ( existingNetworkRelatedToAttachment ( removedAttachment ) . getName ( ) ) ; } java.util.List < java.lang.String > vmNames = getVmInterfaceManager ( ) . findActiveVmsUsingNetworks ( host.getId ( ) , removedNetworks ) ; if ( vmNames.isEmpty ( ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } else { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_CANNOT_DETACH_NETWORK_USED_BY_VMS , commaSeparated ( vmNames ) ) ; } }