auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testGetVolumesByStatusAndTypes ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumes = dao.getVolumesByStatusAndTypes ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.CLUSTER_ID , GlusterStatus.UP , java.util.Collections.singletonList ( GlusterVolumeType.DISTRIBUTE ) ) ; org.junit.Assert.assertNotNull ( volumes ) ; org.junit.Assert.assertTrue ( volumes.contains ( existingDistVol ) ) ; for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume : volumes ) { org.junit.Assert.assertEquals ( GlusterVolumeType.DISTRIBUTE , volume.getVolumeType ( ) ) ; } }

Target:
public void testGetVolumesByStatusAndTypes ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumes = dao.getVolumesByStatusAndTypes ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.CLUSTER_ID , GlusterStatus.UP , java.util.Collections.singletonList ( GlusterVolumeType.DISTRIBUTE ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( volumes ) ; org.junit.jupiter.api.Assertions.assertTrue ( volumes.contains ( existingDistVol ) ) ; for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume : volumes ) { org.junit.jupiter.api.Assertions.assertEquals ( GlusterVolumeType.DISTRIBUTE , volume.getVolumeType ( ) ) ; } }
Source:
protected void ExecuteIrsBrokerCommand ( ) { status = org.ovirt.engine.core.vdsbroker.irsbroker.DeactivateStorageDomainVDSCommand.getIrsProxy ( ) . deactivateStorageDomain ( org.ovirt.engine.core.vdsbroker.irsbroker.DeactivateStorageDomainVDSCommand.getParameters ( ) . getStorageDomainId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.DeactivateStorageDomainVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.DeactivateStorageDomainVDSCommand.getParameters ( ) . getMasterStorageDomainId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.DeactivateStorageDomainVDSCommand.getParameters ( ) . getMasterVersion ( ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.DeactivateStorageDomainVDSCommand.ProceedProxyReturnValue ( ) ; }

Target:
protected void ExecuteIrsBrokerCommand ( ) { status = org.ovirt.engine.core.vdsbroker.irsbroker.DeactivateStorageDomainVDSCommand.getIrsProxy ( ) . deactivateStorageDomain ( org.ovirt.engine.core.vdsbroker.irsbroker.DeactivateStorageDomainVDSCommand.getParameters ( ) . getStorageDomainId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.DeactivateStorageDomainVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.DeactivateStorageDomainVDSCommand.getParameters ( ) . getMasterStorageDomainId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.DeactivateStorageDomainVDSCommand.getParameters ( ) . getMasterVersion ( ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.DeactivateStorageDomainVDSCommand.proceedProxyReturnValue ( ) ; }
Source:
public void testUpdateFieldsIsQuotaDefault ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate src = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; src.setIsQuotaDefault ( true ) ; org.ovirt.engine.core.common.businessentities.VmTemplate dest = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; dest.setIsQuotaDefault ( false ) ; org.junit.Assert.assertTrue ( "Update should be valid for different quota default statuses" , VmTemplateHandler.mUpdateVmTemplate.IsUpdateValid ( src , dest ) ) ; }

Target:
public void testUpdateFieldsIsQuotaDefault ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate src = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; src.setQuotaDefault ( true ) ; org.ovirt.engine.core.common.businessentities.VmTemplate dest = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; dest.setQuotaDefault ( false ) ; org.junit.Assert.assertTrue ( "Update should be valid for different quota default statuses" , VmTemplateHandler.mUpdateVmTemplate.IsUpdateValid ( src , dest ) ) ; }
Source:
protected void setUpEntityQueryExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetNetworkLabelsByHostNicId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { BackendHostNicLabelsResourceTest.nicId } , java.util.Arrays.asList ( getEntity ( 0 ) ) ) ; } }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.network.pseudo.NetworkLabel > getEntityList ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.pseudo.NetworkLabel > labels = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < ( org.ovirt.engine.api.restapi.resource.BackendHostNicLabelResourceTest.LABELS.length ) ; i ++ ) { labels.add ( getEntity ( i ) ) ; } return labels ; }
Source:
protected void ExecuteVmCommand ( ) { if ( ! ( CanRemoveVm ( org.ovirt.engine.core.bll.RemoveVmCommand.getVmId ( ) ) ) ) { return ; } if ( ( ( org.ovirt.engine.core.bll.RemoveVmCommand.getVm ( ) . getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.ImageLocked ) ) || ( ! ( org.ovirt.engine.core.bll.RemoveVmCommand.getParameters ( ) . getForce ( ) ) ) ) { org.ovirt.engine.core.bll.VmHandler.checkStatusAndLockVm ( org.ovirt.engine.core.bll.RemoveVmCommand.getVmId ( ) , org.ovirt.engine.core.bll.RemoveVmCommand.getCompensationContext ( ) ) ; } org.ovirt.engine.core.bll.RemoveVmCommand.freeLock ( ) ; org.ovirt.engine.core.bll.RemoveVmCommand.setSucceeded ( removeVm ( ) ) ; }

Target:
protected boolean canDoAction ( ) { boolean retVal = true ; if ( ( org.ovirt.engine.core.bll.RemoveVmCommand.getVm ( ) ) == null ) { retVal = false ; addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_FOUND ) ; } else { retVal = ( super . canDoAction ( ) ) && ( canRemoveVm ( ) ) ; setDescription ( org.ovirt.engine.core.bll.RemoveVmCommand.getVmName ( ) ) ; } return retVal ; }
Source:
public void testConflictedUpdate ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 ) ; org.ovirt.engine.api.model.OpenStackVolumeProvider model = getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }

Target:
public void testConflictedUpdate ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 ) ; org.ovirt.engine.api.model.OpenStackVolumeProvider model = getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }
Source:
public static void getUserMessageOfTheDayViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.UserMessageOfTheDay , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : "" ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( hookId ) ; parameters.setGlusterServerId ( serverId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }
Source:
private void initMemoryHotUnplugSupportMap ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { memoryHotUnplugSupport = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetArchitectureCapabilities , new org.ovirt.engine.core.common.queries.ArchCapabilitiesParameters ( org.ovirt.engine.core.common.queries.ArchCapabilitiesParameters.ArchCapabilitiesVerb.GetMemoryHotUnplugSupport ) , callback ) ; }

Target:
private void initMemoryHotUnplugSupportMap ( ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetArchitectureCapabilities , new org.ovirt.engine.core.common.queries.ArchCapabilitiesParameters ( org.ovirt.engine.core.common.queries.ArchCapabilitiesParameters.ArchCapabilitiesVerb.GetMemoryHotUnplugSupport ) , new org.ovirt.engine.ui.frontend.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 ) { memoryHotUnplugSupport = returnValue.getReturnValue ( ) ; } } ) ) ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Tags > ret = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Tags > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Tags tags : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Tags > ) ( source ) ) ) { if ( ( tags.gettype ( ) ) == ( org.ovirt.engine.core.common.businessentities.TagsType.GeneralTag ) ) { ret.add ( tags ) ; } } return ret ; } return new org.ovirt.engine.core.common.businessentities.Tags ( ) ; }

Target:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Tags > ret = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Tags tags : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Tags > ) ( source ) ) ) { if ( ( tags.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.TagsType.GeneralTag ) ) { ret.add ( tags ) ; } } return ret ; } return new org.ovirt.engine.core.common.businessentities.Tags ( ) ; }
Source:
public void getLocalStorageHost ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String dataCenterName ) { 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 ) { for ( org.ovirt.engine.core.common.businessentities.IVdcQueryable item : ( ( java.util.List < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) { return item ; } } return null ; } } ; org.ovirt.engine.core.common.queries.SearchParameters sp = new org.ovirt.engine.core.common.queries.SearchParameters ( ( "hosts: datacenter=" + dataCenterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VDS ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , sp , aQuery ) ; }

Target:
public void getLocalStorageHost ( org.ovirt.engine.ui.frontend.AsyncQuery < org.ovirt.engine.core.common.businessentities.VDS > aQuery , java.lang.String dataCenterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetFirstConverter < > ( ) ; org.ovirt.engine.core.common.queries.SearchParameters sp = new org.ovirt.engine.core.common.queries.SearchParameters ( ( "hosts: datacenter=" + dataCenterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VDS ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , sp , aQuery ) ; }
Source:
private javax.ws.rs.core.UriInfo mockUri ( java.lang.String ... strings ) throws java.net.URISyntaxException { javax.ws.rs.core.UriInfo uriInfoMock = org.mockito.Mockito.mock ( javax.ws.rs.core.UriInfo.class ) ; org.mockito.Mockito.when ( uriInfoMock.getBaseUri ( ) ) . thenReturn ( new java.net.URI ( "http://localhost:8080/ovirt-engine/api/" ) ) ; java.util.List < javax.ws.rs.core.PathSegment > pathSegments = new java.util.ArrayList < > ( ) ; for ( java.lang.String s : strings ) { javax.ws.rs.core.PathSegment segment = org.mockito.Mockito.mock ( javax.ws.rs.core.PathSegment.class ) ; org.mockito.Mockito.when ( segment.getPath ( ) ) . thenReturn ( s ) ; pathSegments.add ( segment ) ; } org.mockito.Mockito.when ( uriInfoMock.getPathSegments ( ) ) . thenReturn ( pathSegments ) ; return uriInfoMock ; }

Target:
private javax.ws.rs.core.UriInfo mockUri ( java.lang.String ... strings ) throws java.net.URISyntaxException { javax.ws.rs.core.UriInfo uriInfoMock = org.mockito.Mockito.mock ( javax.ws.rs.core.UriInfo.class ) ; java.util.List < javax.ws.rs.core.PathSegment > pathSegments = new java.util.ArrayList < > ( ) ; for ( java.lang.String s : strings ) { javax.ws.rs.core.PathSegment segment = org.mockito.Mockito.mock ( javax.ws.rs.core.PathSegment.class ) ; org.mockito.Mockito.when ( segment.getPath ( ) ) . thenReturn ( s ) ; pathSegments.add ( segment ) ; } org.mockito.Mockito.when ( uriInfoMock.getPathSegments ( ) ) . thenReturn ( pathSegments ) ; return uriInfoMock ; }
Source:
public void flushToPrivateModel ( ) { if ( spiceRadioButton.asRadioButton ( ) . getValue ( ) ) { setSelectedProtocol ( ConsoleProtocol.SPICE ) ; setSelectedSpiceImpl ( ) ; } else if ( remoteDesktopRadioButton.asRadioButton ( ) . getValue ( ) ) { setSelectedProtocol ( ConsoleProtocol.RDP ) ; setSelectedRdpImpl ( ) ; } else if ( vncRadioButton.asRadioButton ( ) . getValue ( ) ) { setSelectedProtocol ( ConsoleProtocol.VNC ) ; } flushCheckBoxes ( ctrlAltDel , enableUsbAutoshare , openInFullScreen , enableSpiceProxy , useLocalDrives , wanEnabled , disableSmartcard ) ; }

Target:
public void flushToPrivateModel ( ) { if ( spiceRadioButton.asRadioButton ( ) . getValue ( ) ) { setSelectedProtocol ( ConsoleProtocol.SPICE ) ; setSelectedSpiceImpl ( ) ; } else if ( remoteDesktopRadioButton.asRadioButton ( ) . getValue ( ) ) { setSelectedProtocol ( ConsoleProtocol.RDP ) ; setSelectedRdpImpl ( ) ; } else if ( vncRadioButton.asRadioButton ( ) . getValue ( ) ) { setSelectedProtocol ( ConsoleProtocol.VNC ) ; setSelectedVncImpl ( ) ; } flushCheckBoxes ( ctrlAltDel , enableUsbAutoshare , openInFullScreen , enableSpiceProxy , useLocalDrives , wanEnabled , disableSmartcard ) ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidator validator = new org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidator ( getNetworkCluster ( ) ) ; return ( validate ( networkClusterAttachmentExists ( ) ) ) && ( ( ! ( org.ovirt.engine.core.utils.NetworkUtils.isManagementNetwork ( getNetwork ( ) ) ) ) || ( validate ( validator.managementNetworkAttachment ( getNetworkName ( ) ) ) ) ) ; }

Target:
private boolean validateAttachment ( ) { org.ovirt.engine.core.compat.Version clusterVersion = org.ovirt.engine.core.bll.network.cluster.UpdateNetworkOnClusterCommand.getVdsGroupDAO ( ) . get ( getNetworkCluster ( ) . getClusterId ( ) ) . getcompatibility_version ( ) ; org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidator validator = new org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidator ( getNetworkCluster ( ) , clusterVersion ) ; return ( ( ! ( org.ovirt.engine.core.utils.NetworkUtils.isManagementNetwork ( getNetwork ( ) ) ) ) || ( validate ( validator.managementNetworkAttachment ( getNetworkName ( ) ) ) ) ) && ( validate ( validator.migrationPropertySupported ( getNetworkName ( ) ) ) ) ; }
Source:
public javax.ws.rs.core.Response remove ( org.ovirt.engine.api.model.Action action ) { return ( ( org.ovirt.engine.api.restapi.resource.BackendVmDisksResource ) ( collection ) ) . deprecatedRemove ( id , action ) ; }

Target:
public javax.ws.rs.core.Response remove ( org.ovirt.engine.api.model.Action action ) { get ( ) ; if ( ( action.isSetDetach ( ) ) && ( action.isDetach ( ) ) ) { return performAction ( VdcActionType.DetachDiskFromVm , new org.ovirt.engine.core.common.action.AttachDetachVmDiskParameters ( vmId , guid ) ) ; } else { return performAction ( VdcActionType.RemoveDisk , new org.ovirt.engine.core.common.action.RemoveDiskParameters ( guid ) ) ; } }
Source:
protected void handleSpecificCommandActions ( ) { if ( ( mVmList.size ( ) ) > 0 ) { org.ovirt.engine.core.bll.StopVdsCommand.RestartVdsVms ( ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.UpdateVdsVMsCleared , new org.ovirt.engine.core.common.vdscommands.UpdateVdsVMsClearedVDSCommandParameters ( org.ovirt.engine.core.bll.StopVdsCommand.getVds ( ) . getId ( ) ) ) ; } }

Target:
protected void handleSpecificCommandActions ( ) { if ( ( mVmList.size ( ) ) > 0 ) { org.ovirt.engine.core.bll.StopVdsCommand.restartVdsVms ( ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.UpdateVdsVMsCleared , new org.ovirt.engine.core.common.vdscommands.UpdateVdsVMsClearedVDSCommandParameters ( org.ovirt.engine.core.bll.StopVdsCommand.getVds ( ) . getId ( ) ) ) ; } }
Source:
public void testStorageDomainTemplateLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Template template = new org.ovirt.engine.api.model.Template ( ) ; template.setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.TEMPLATE_ID ) ; template.setStorageDomain ( new org.ovirt.engine.api.model.StorageDomain ( ) ) ; template.getStorageDomain ( ) . setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_DOMAIN_ID ) ; template = org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( template ) ; assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_DOMAIN_TEMPLATE_HREF , template.getHref ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_DOMAIN_HREF , template.getStorageDomain ( ) . getHref ( ) ) ; }

Target:
public void testStorageDomainTemplateLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Template template = new org.ovirt.engine.api.model.Template ( ) ; template.setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.TEMPLATE_ID ) ; template.setStorageDomain ( new org.ovirt.engine.api.model.StorageDomain ( ) ) ; template.getStorageDomain ( ) . setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_DOMAIN_ID ) ; template = org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( template ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_DOMAIN_TEMPLATE_HREF , template.getHref ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_DOMAIN_HREF , template.getStorageDomain ( ) . getHref ( ) ) ; }
Source:
protected void RemoveSnapshotFromDB ( org.ovirt.engine.core.common.businessentities.DiskImage snapshot ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getImageStorageDomainMapDao ( ) . remove ( snapshot.getImageId ( ) ) ; getImageDao ( ) . remove ( snapshot.getImageId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > imagesForDisk = getDiskImageDao ( ) . getAllSnapshotsForImageGroup ( snapshot.getId ( ) ) ; if ( ( imagesForDisk == null ) || ( imagesForDisk.isEmpty ( ) ) ) { getBaseDiskDao ( ) . remove ( snapshot.getId ( ) ) ; } }

Target:
protected void RemoveSnapshot ( org.ovirt.engine.core.common.businessentities.DiskImage snapshot ) { org.ovirt.engine.core.bll.BaseImagesCommand.getImageStorageDomainMapDao ( ) . remove ( snapshot.getImageId ( ) ) ; getImageDao ( ) . remove ( snapshot.getImageId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > imagesForDisk = getDiskImageDao ( ) . getAllSnapshotsForImageGroup ( snapshot.getId ( ) ) ; if ( ( imagesForDisk == null ) || ( imagesForDisk.isEmpty ( ) ) ) { getBaseDiskDao ( ) . remove ( snapshot.getId ( ) ) ; } }
Source:
public void testGetServerHooks ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook serverHook1 = getGlusterServerHook ( org.ovirt.engine.core.dao.gluster.GlusterHooksDaoTest.SERVER_ID , GlusterHookStatus.ENABLED , GlusterHookContentType.TEXT , org.ovirt.engine.core.dao.gluster.GlusterHooksDaoTest.CHECKSUM_HOOK1_SERVER1 ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook serverHook2 = getGlusterServerHook ( org.ovirt.engine.core.dao.gluster.GlusterHooksDaoTest.SERVER_ID2 , GlusterHookStatus.MISSING , null , null ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook > serverHooks = dao.getGlusterServerHooks ( FixturesTool.HOOK_ID ) ; org.junit.Assert.assertNotNull ( serverHooks ) ; org.junit.Assert.assertEquals ( 2 , serverHooks.size ( ) ) ; org.junit.Assert.assertTrue ( serverHooks.contains ( serverHook1 ) ) ; org.junit.Assert.assertTrue ( serverHooks.contains ( serverHook2 ) ) ; }

Target:
public void testGetServerHooks ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook serverHook1 = getGlusterServerHook ( org.ovirt.engine.core.dao.gluster.GlusterHooksDaoTest.SERVER_ID , GlusterHookStatus.ENABLED , GlusterHookContentType.TEXT , org.ovirt.engine.core.dao.gluster.GlusterHooksDaoTest.CHECKSUM_HOOK1_SERVER1 ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook serverHook2 = getGlusterServerHook ( FixturesTool.GLUSTER_BRICK_SERVER1 , GlusterHookStatus.MISSING , null , null ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook > serverHooks = dao.getGlusterServerHooks ( FixturesTool.HOOK_ID ) ; org.junit.Assert.assertNotNull ( serverHooks ) ; org.junit.Assert.assertEquals ( 2 , serverHooks.size ( ) ) ; org.junit.Assert.assertTrue ( serverHooks.contains ( serverHook1 ) ) ; org.junit.Assert.assertTrue ( serverHooks.contains ( serverHook2 ) ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > getLUNs ( org.ovirt.engine.core.compat.Guid sdId , java.lang.String vgId ) { org.ovirt.engine.core.common.businessentities.storage.LUNs lun1 = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lun1.setStorageDomainId ( sdId ) ; lun1.setvolume_group_id ( vgId ) ; lun1.setLunConnections ( new java.util.ArrayList ( getConnections ( ) ) ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lun2 = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lun2.setStorageDomainId ( sdId ) ; lun2.setvolume_group_id ( vgId ) ; lun2.setLunConnections ( new java.util.ArrayList ( getConnections ( ) ) ) ; return new java.util.ArrayList ( java.util.Arrays.asList ( lun1 , lun2 ) ) ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > getLUNs ( org.ovirt.engine.core.compat.Guid sdId , java.lang.String vgId ) { org.ovirt.engine.core.common.businessentities.storage.LUNs lun1 = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lun1.setStorageDomainId ( sdId ) ; lun1.setVolumeGroupId ( vgId ) ; lun1.setLunConnections ( new java.util.ArrayList ( getConnections ( ) ) ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lun2 = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lun2.setStorageDomainId ( sdId ) ; lun2.setVolumeGroupId ( vgId ) ; lun2.setLunConnections ( new java.util.ArrayList ( getConnections ( ) ) ) ; return new java.util.ArrayList ( java.util.Arrays.asList ( lun1 , lun2 ) ) ; }
Source:
public void render ( org.ovirt.engine.ui.userportal.widget.extended.vm.Context context , org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel model , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { if ( isConsoleEnabled ( model ) ) { sb.appendHtmlConstant ( ( ( ( ( "<div title=\"" + ( title ) ) + "\" class=\"" ) + ( enabledCss ) ) + "\" />" ) ) ; } else { sb.appendHtmlConstant ( ( ( "<div class=\"" + ( disabledCss ) ) + "\" />" ) ) ; } }

Target:
public void render ( org.ovirt.engine.ui.userportal.widget.extended.vm.Context context , org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel model , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { if ( isConsoleEnabled ( model ) ) { sb.appendHtmlConstant ( ( ( ( ( ( ( "<div id=\"" + ( org.ovirt.engine.ui.common.utils.ElementIdUtils.createTableCellElementId ( elementIdPrefix , columnId , context ) ) ) + "\" title=\"" ) + ( title ) ) + "\" class=\"" ) + ( enabledCss ) ) + "\"/>" ) ) ; } else { sb.appendHtmlConstant ( ( ( "<div class=\"" + ( disabledCss ) ) + "\" />" ) ) ; } }
Source:
public void testGetAllUsersWithPermissionsOnEntity ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Permissions > result = dao.getAllForEntity ( org.ovirt.engine.core.dao.PermissionDAOTest.VM_ENTITY_ID , org.ovirt.engine.core.dao.PRIVILEGED_USER_SESSION_ID , true , true ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( 2 , result.size ( ) ) ; org.ovirt.engine.core.dao.PermissionDAOTest.assertGetAllForEntityResult ( result ) ; }

Target:
public void testGetAllForEntityFilteredWithPermissions ( ) { org.junit.Assert.assertNotNull ( privilegedUserSession ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Permissions > result = dao.getAllForEntity ( org.ovirt.engine.core.dao.PermissionDAOTest.VM_ENTITY_ID , privilegedUserSession.getId ( ) , true ) ; org.ovirt.engine.core.dao.PermissionDAOTest.assertGetAllForEntityResult ( result ) ; }
Source:
public 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.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public void getPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { 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.Permission > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permission > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }
Source:
private void waitUntilCheck ( java.util.function.Predicate < org.ovirt.vdsm.jsonrpc.client.JsonRpcClient > check , java.lang.String formatBefore , java.lang.String formatAfter ) throws java.lang.InterruptedException { java.lang.String hostname = client.getHostname ( ) ; org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcVdsServer.logger.debug ( formatBefore , hostname ) ; int retries = 50 ; while ( check.test ( this . client ) ) { if ( retries == 0 ) { throw new org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException ( ( ( "Unable to reconnect to " + hostname ) + " after policy reset" ) ) ; } retries -- ; java.util.concurrent.TimeUnit.MILLISECONDS.sleep ( 200 ) ; } org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcVdsServer.logger.debug ( formatAfter , hostname ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn amendVolume ( java.lang.String jobId , java.util.Map < java.lang.String , java.lang.Object > volInfo , java.util.Map < java.lang.String , java.lang.Object > volAttr ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "SDM.amend_volume" ) . withParameter ( "job_id" , jobId ) . withParameter ( "vol_info" , volInfo ) . withParameter ( "vol_attr" , volAttr ) . 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.StatusOnlyReturn ( response ) ; }
Source:
public static boolean isVmWithSameNameExistStatic ( java.lang.String vmName ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmStatic > vmStatic = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmStaticDao ( ) . getAllByName ( vmName ) ; return ( vmStatic.size ( ) ) != 0 ; }

Target:
public static boolean isVmWithSameNameExistStatic ( java.lang.String vmName , org.ovirt.engine.core.compat.Guid storagePoolId ) { org.ovirt.engine.core.common.queries.NameQueryParameters params = new org.ovirt.engine.core.common.queries.NameQueryParameters ( vmName ) ; params.setDatacenterId ( storagePoolId ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue result = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalQuery ( VdcQueryType.IsVmWithSameNameExist , params ) ; return ( ( java.lang.Boolean ) ( result.getReturnValue ( ) ) ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.VmTemplate readVmTemplateFromOvf ( java.lang.String ovf ) throws org.ovirt.engine.core.utils.ovf.OvfReaderException { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > diskImages = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > interfaces = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; org.ovirt.engine.core.common.businessentities.VmTemplate template = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; ovfManager.ImportTemplate ( ovf , template , diskImages , interfaces ) ; template.setInterfaces ( interfaces ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : diskImages ) { template.getDiskTemplateMap ( ) . put ( disk.getId ( ) , disk ) ; } return template ; }

Target:
public org.ovirt.engine.core.common.businessentities.VmTemplate readVmTemplateFromOvf ( java.lang.String ovf ) throws org.ovirt.engine.core.utils.ovf.OvfReaderException { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImages = new java.util.ArrayList < > ( ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > interfaces = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.VmTemplate template = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; ovfManager.ImportTemplate ( ovf , template , diskImages , interfaces ) ; template.setInterfaces ( interfaces ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk : diskImages ) { template.getDiskTemplateMap ( ) . put ( disk.getId ( ) , disk ) ; } return template ; }
Source:
public void validateFailsOnNullCluster ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterClusterParameters ( null ) , null ) ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_CLUSTER_IS_NOT_VALID.toString ( ) ) ) ; }

Target:
public void validateFailsOnNullCluster ( ) { cmd.setClusterId ( null ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_CLUSTER_IS_NOT_VALID.toString ( ) ) ) ; }
Source:
public void testDiskAttachedToVMValid ( ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.validator.storage.DiskValidatorTest.createVM ( ) ; org.mockito.Mockito.when ( vmDao.getVmsListForDisk ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.anyBoolean ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( vm ) ) ; org.junit.Assert.assertThat ( validator.isDiskAttachedToVm ( vm ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testDiskAttachedToVMValid ( ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.validator.storage.DiskValidatorTest.createVM ( ) ; org.mockito.Mockito.when ( vmDao.getVmsListForDisk ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.anyBoolean ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( vm ) ) ; org.hamcrest.MatcherAssert.assertThat ( validator.isDiskAttachedToVm ( vm ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > filterStorageDomains ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsInPool , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > memoryDisks ) { domainsInPool = new java.util.LinkedList ( domainsInPool ) ; java.util.Iterator < org.ovirt.engine.core.common.businessentities.StorageDomain > iterator = domainsInPool.iterator ( ) ; while ( iterator.hasNext ( ) ) { if ( ! ( getPredicate ( memoryDisks ) . eval ( iterator.next ( ) ) ) ) { iterator.remove ( ) ; } } return domainsInPool ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > filterStorageDomains ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsInPool , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > memoryDisks ) { return domainsInPool.stream ( ) . filter ( getPredicate ( memoryDisks ) ) . collect ( java.util.stream.Collectors.toList ( ) ) ; }
Source:
public void onSuccess ( org.ovirt.engine.core.common.businessentities.Cluster cluster ) { if ( cluster != null ) { maintenance ( cluster.isMaintenanceReasonRequired ( ) , cluster.supportsGlusterService ( ) ) ; } }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel localModel = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( result.getState ( ) ) ) ; localModel.stopProgress ( ) ; if ( ( ( result.getReturnValue ( ) ) != null ) && ( result.getReturnValue ( ) . getSucceeded ( ) ) ) { cancelConfirm ( ) ; } }
Source:
private void initFilters ( ) { java.util.List < org.ovirt.engine.core.bll.memory.MemoryStorageHandlerTest.StorageDomainRejectingFilter > storageDomainFilters = java.util.Arrays.asList ( new org.ovirt.engine.core.bll.memory.MemoryStorageHandlerTest.StorageDomainRejectingFilter ( invalidStorageDomain1 ) , new org.ovirt.engine.core.bll.memory.MemoryStorageHandlerTest.StorageDomainRejectingFilter ( invalidStorageDomain2 ) , new org.ovirt.engine.core.bll.memory.MemoryStorageHandlerTest.StorageDomainRejectingFilter ( invalidStorageDomain3 ) ) ; org.mockito.Mockito.doReturn ( storageDomainFilters ) . when ( memoryStorageHandler ) . getStorageDomainFilters ( memoryDisks ) ; }

Target:
private void initFilters ( ) { java.util.List < java.util.function.Predicate < org.ovirt.engine.core.common.businessentities.StorageDomain > > storageDomainFilters = java.util.Arrays.asList ( ( d ) -> ! ( d.equals ( invalidStorageDomain1 ) ) , ( d ) -> ! ( d.equals ( invalidStorageDomain2 ) ) , ( d ) -> ! ( d.equals ( invalidStorageDomain3 ) ) ) ; org.mockito.Mockito.doReturn ( storageDomainFilters ) . when ( memoryStorageHandler ) . getStorageDomainFilters ( memoryDisks ) ; }
Source:
public void testSubResourceLocatorBadGuid ( ) throws java.lang.Exception { control.replay ( ) ; try { collection.getDeviceResource ( "foo" ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testListCrashClientLocale ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; locales.add ( org.ovirt.engine.api.restapi.resource.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpEntityQueryExpectations ( 1 , t ) ; control.replay ( ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_CLIENT_LOCALE , t ) ; } finally { locales.clear ( ) ; } }
Source:
private void testDiscardFieldsParsing ( org.ovirt.engine.core.compat.Version poolCompatibilityVersion , java.lang.Long expectedDiscardMaxSize , java.lang.Boolean expectedDiscardZeroesData ) { java.util.Map < java.lang.String , java.lang.Object > xlun = new java.util.HashMap < > ( ) ; xlun.put ( "discard_max_bytes" , 1024L ) ; xlun.put ( "discard_zeroes_data" , 1 ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lun = org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.parseLunFromXmlRpc ( xlun , poolCompatibilityVersion ) ; org.junit.Assert.assertEquals ( lun.getDiscardMaxSize ( ) , expectedDiscardMaxSize ) ; org.junit.Assert.assertEquals ( lun.getDiscardZeroesData ( ) , expectedDiscardZeroesData ) ; }

Target:
private void testDiscardFieldsParsing ( org.ovirt.engine.core.compat.Version poolCompatibilityVersion , java.lang.Long expectedDiscardMaxSize , java.lang.Boolean expectedDiscardZeroesData ) { java.util.Map < java.lang.String , java.lang.Object > xlun = new java.util.HashMap < > ( ) ; xlun.put ( "discard_max_bytes" , 1024L ) ; xlun.put ( "discard_zeroes_data" , 1 ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lun = org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.parseLun ( xlun , poolCompatibilityVersion ) ; org.junit.Assert.assertEquals ( lun.getDiscardMaxSize ( ) , expectedDiscardMaxSize ) ; org.junit.Assert.assertEquals ( lun.getDiscardZeroesData ( ) , expectedDiscardZeroesData ) ; }
Source:
public void testValidUpdateOfEditableFieldOnDownVm ( ) { org.ovirt.engine.core.common.businessentities.VmStatic src = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; src.setClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.VmStatic dest = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; dest.setClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; boolean updateIsValid = vmHandler.isUpdateValid ( src , dest , VMStatus.Down , false ) ; org.junit.Assert.assertTrue ( "Update should be valid for different cluster IDs in the down state" , updateIsValid ) ; }

Target:
public void testValidUpdateOfEditableFieldOnDownVm ( ) { org.ovirt.engine.core.common.businessentities.VmStatic src = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; src.setClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.VmStatic dest = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; dest.setClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; boolean updateIsValid = vmHandler.isUpdateValid ( src , dest , VMStatus.Down , false ) ; org.junit.jupiter.api.Assertions.assertTrue ( updateIsValid , "Update should be valid for different cluster IDs in the down state" ) ; }
Source:
public void getGlusterHooks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }

Target:
public void getLocalStorageHost ( org.ovirt.engine.ui.frontend.AsyncQuery < org.ovirt.engine.core.common.businessentities.VDS > aQuery , java.lang.String dataCenterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetFirstConverter < > ( ) ; org.ovirt.engine.core.common.queries.SearchParameters sp = new org.ovirt.engine.core.common.queries.SearchParameters ( ( "hosts: datacenter=" + dataCenterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VDS ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , sp , aQuery ) ; }
Source:
private java.lang.String processResponseHeaderValue ( org.apache.commons.httpclient.HttpMethodBase method , java.lang.String headerName , java.lang.String expectedValue ) { org.apache.commons.httpclient.Header header = method.getResponseHeader ( headerName ) ; if ( header == null ) { throwVdsErrorException ( ( "UploadStreamVDSCommand - response was missing the following header: " + headerName ) , VdcBllErrors.GeneralException ) ; } if ( ( expectedValue != null ) && ( ! ( expectedValue.equals ( header.getValue ( ) ) ) ) ) { throwVdsErrorException ( ( "UploadStreamVDSCommand - response header value unexpected for header: " + headerName ) , VdcBllErrors.GeneralException ) ; } return header.getValue ( ) ; }

Target:
protected int getSuccessCode ( ) { return org.apache.commons.httpclient.HttpStatus.SC_OK ; }
Source:
private boolean isDiskLun ( ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = org.ovirt.engine.core.bll.CopyImageGroupCommand.getDiskDao ( ) . get ( org.ovirt.engine.core.bll.CopyImageGroupCommand.getParameters ( ) . getImageGroupID ( ) ) ; return ! ( validate ( new org.ovirt.engine.core.bll.validator.storage.DiskValidator ( disk ) . validateDiskIsNotLun ( ) ) ) ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = org.ovirt.engine.core.bll.CopyImageGroupCommand.getDiskDao ( ) . get ( org.ovirt.engine.core.bll.CopyImageGroupCommand.getParameters ( ) . getImageGroupID ( ) ) ; if ( disk != null ) { org.ovirt.engine.core.bll.validator.storage.DiskValidator diskValidator = new org.ovirt.engine.core.bll.validator.storage.DiskValidator ( disk ) ; return validate ( diskValidator.validateUnsupportedDiskStorageType ( DiskStorageType.LUN , DiskStorageType.CINDER ) ) ; } return false ; }
Source:
public void testGetEntityNameByIdAndTypeForUser ( ) { org.ovirt.engine.core.common.businessentities.DbUser dbUser = dbFacade.getDbUserDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDAOTest.USER_ID ) ; org.junit.Assert.assertNotNull ( dbUser ) ; java.lang.String name = dbUser.getusername ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDAOTest.USER_ID , VdcObjectType.User ) ) ) ; }

Target:
public void testGetEntityNameByIdAndTypeForUser ( ) { org.ovirt.engine.core.common.businessentities.DbUser dbUser = dbFacade.getDbUserDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDAOTest.USER_ID ) ; org.junit.Assert.assertNotNull ( dbUser ) ; java.lang.String name = dbUser.getLoginName ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDAOTest.USER_ID , VdcObjectType.User ) ) ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assert query.equals ( "" ) ; setUpEntityQueryExpectations ( VdcQueryType.GetRoleActionGroupsByRoleId , org.ovirt.engine.core.common.queries.MultilevelAdministrationByRoleIdParameters.class , new java.lang.String [ ] { "RoleId" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , org.ovirt.engine.api.restapi.resource.BackendPermitsResourceTest.setUpActionGroups ( ) , failure ) ; control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assert query.equals ( "" ) ; setUpEntityQueryExpectations ( VdcQueryType.GetRoleActionGroupsByRoleId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , org.ovirt.engine.api.restapi.resource.BackendPermitsResourceTest.setUpActionGroups ( ) , failure ) ; control.replay ( ) ; }
Source:
public void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : "" ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( hookId ) ; parameters.setGlusterServerId ( serverId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }

Target:
public void getGlusterSwiftServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByServerId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( serverId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }
Source:
public void testGetAllForSubscriber ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.event_subscriber > result = dao.getAllForSubscriber ( existingSubscriber ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.event_subscriber subscription : result ) { org.junit.Assert.assertEquals ( existingSubscriber , subscription.getsubscriber_id ( ) ) ; } }

Target:
public void testGetAllForSubscriber ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.EventSubscriber > result = dao.getAllForSubscriber ( existingSubscriber ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.EventSubscriber subscription : result ) { org.junit.Assert.assertEquals ( existingSubscriber , subscription.getSubscriberId ( ) ) ; } }