auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testMoveNamedParent ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetTagByTagName , org.ovirt.engine.core.common.queries.GetTagByTagNameParameters.class , new java.lang.String [ ] { "TagName" } , new java.lang.Object [ ] { NAMES [ org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.PARENT_IDX ] } , getEntity ( org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.PARENT_IDX ) ) ; org.ovirt.engine.api.model.Tag model = org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.getModel ( 0 ) ; model.getParent ( ) . getTag ( ) . setId ( null ) ; model.getParent ( ) . getTag ( ) . setName ( NAMES [ org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.PARENT_IDX ] ) ; doTestMove ( model , 0 ) ; }

Target:
public void testMoveNamedParent ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetTagByTagName , org.ovirt.engine.core.common.queries.GetTagByTagNameParameters.class , new java.lang.String [ ] { "TagName" } , new java.lang.Object [ ] { NAMES [ org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.PARENT_IDX ] } , getEntity ( org.ovirt.engine.api.restapi.resource.BackendTagResourceTest.NEW_PARENT_IDX ) ) ; org.ovirt.engine.api.model.Tag model = org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.getModel ( 0 ) ; model.getParent ( ) . getTag ( ) . setId ( null ) ; model.getParent ( ) . getTag ( ) . setName ( NAMES [ org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.PARENT_IDX ] ) ; doTestMove ( model , 0 ) ; }
Source:
void initListBoxEditors ( ) { isoEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor < org.ovirt.engine.core.compat.RpmVersion > ( new org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer < org.ovirt.engine.core.compat.RpmVersion > ( ) { @ java.lang.Override public java.lang.String renderNullSafe ( org.ovirt.engine.core.compat.RpmVersion version ) { return version.getRpmName ( ) ; } } ) ; rbPassword = new com.google.gwt.user.client.ui.RadioButton ( "1" ) ; rbPublicKey = new com.google.gwt.user.client.ui.RadioButton ( "1" ) ; publicKeyEditor = new org.ovirt.engine.ui.common.widget.editor.generic.StringEntityModelTextAreaLabelEditor ( ) ; }

Target:
void initEditors ( ) { isoEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor ( new org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer < org.ovirt.engine.core.compat.RpmVersion > ( ) { @ java.lang.Override public java.lang.String renderNullSafe ( org.ovirt.engine.core.compat.RpmVersion version ) { return version.getRpmName ( ) ; } } ) ; rbPassword = new com.google.gwt.user.client.ui.RadioButton ( "1" ) ; rbPublicKey = new com.google.gwt.user.client.ui.RadioButton ( "1" ) ; publicKeyEditor = new org.ovirt.engine.ui.common.widget.editor.generic.StringEntityModelTextAreaLabelEditor ( ) ; activateHostAfterInstallEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; overrideIpTablesEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; }
Source:
public void getGlusterBricksForServer ( 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.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }

Target:
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 ) ; }
Source:
public java.lang.Object runInTransaction ( ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage di : org.ovirt.engine.core.bll.lsm.VmReplicateDiskFinishTaskHandler.getDiskImageDao ( ) . getAllSnapshotsForImageGroup ( getEnclosingCommand ( ) . getParameters ( ) . getImageGroupID ( ) ) ) { org.ovirt.engine.core.bll.lsm.VmReplicateDiskFinishTaskHandler.getImageStorageDomainMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.ImageStorageDomainMapId ( di.getImageId ( ) , sourceStorageDomainId ) ) ; org.ovirt.engine.core.bll.lsm.VmReplicateDiskFinishTaskHandler.getImageStorageDomainMapDao ( ) . save ( new org.ovirt.engine.core.common.businessentities.image_storage_domain_map ( di.getImageId ( ) , targetStorageDomainId ) ) ; } return null ; }

Target:
public java.lang.Object runInTransaction ( ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage di : org.ovirt.engine.core.bll.lsm.VmReplicateDiskFinishTaskHandler.getDiskImageDao ( ) . getAllSnapshotsForImageGroup ( getEnclosingCommand ( ) . getParameters ( ) . getImageGroupID ( ) ) ) { org.ovirt.engine.core.bll.lsm.VmReplicateDiskFinishTaskHandler.getImageStorageDomainMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.ImageStorageDomainMapId ( di.getImageId ( ) , sourceStorageDomainId ) ) ; org.ovirt.engine.core.bll.lsm.VmReplicateDiskFinishTaskHandler.getImageStorageDomainMapDao ( ) . save ( new org.ovirt.engine.core.common.businessentities.image_storage_domain_map ( di.getImageId ( ) , targetStorageDomainId , di.getQuotaId ( ) ) ) ; } return null ; }
Source:
public void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { 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.storage.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisksForVm , params , aQuery ) ; }

Target:
public void getVmSnapshotList ( 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 ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
private void removeEntireDisk ( ) { org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk = ( ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk ) ( org.ovirt.engine.core.bll.storage.RestoreFromCinderSnapshotCommand.getDiskImageDao ( ) . getSnapshotById ( org.ovirt.engine.core.bll.storage.RestoreFromCinderSnapshotCommand.getParameters ( ) . getImageId ( ) ) ) ) ; removeCinderDisk ( cinderDisk ) ; }

Target:
private void removeCinderVolume ( ) { org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderSnapshotToRemove = ( ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk ) ( org.ovirt.engine.core.bll.storage.RestoreFromCinderSnapshotCommand.getDiskImageDao ( ) . getSnapshotById ( org.ovirt.engine.core.bll.storage.RestoreFromCinderSnapshotCommand.getParameters ( ) . getImageId ( ) ) ) ) ; cinderSnapshotToRemove.setActive ( false ) ; org.ovirt.engine.core.bll.storage.RestoreFromCinderSnapshotCommand.getImageDao ( ) . update ( cinderSnapshotToRemove.getImage ( ) ) ; removeDescendentSnapshots ( cinderSnapshotToRemove ) ; removeCinderVolume ( cinderSnapshotToRemove.getStorageIds ( ) . get ( 0 ) , 0 ) ; }
Source:
protected void endActionOnAllImageGroups ( ) { for ( org.ovirt.engine.core.common.action.VdcActionParametersBase p : getParameters ( ) . getImagesParameters ( ) ) { p.setTaskGroupSuccess ( getParameters ( ) . getTaskGroupSuccess ( ) ) ; org.ovirt.engine.core.bll.ImportVmCommand.getBackend ( ) . endAction ( org.ovirt.engine.core.bll.ImportVmCommand.getImagesActionType ( ) , p ) ; } }

Target:
protected void endActionOnAllImageGroups ( ) { for ( org.ovirt.engine.core.common.action.VdcActionParametersBase p : getParameters ( ) . getImagesParameters ( ) ) { p.setTaskGroupSuccess ( getParameters ( ) . getTaskGroupSuccess ( ) ) ; org.ovirt.engine.core.bll.ImportVmCommand.getBackend ( ) . endAction ( org.ovirt.engine.core.bll.ImportVmCommand.getImagesActionType ( ) , p , org.ovirt.engine.core.bll.ImportVmCommand.getContext ( ) . clone ( ) . withoutCompensationContext ( ) . withoutExecutionContext ( ) . withoutLock ( ) ) ; } }
Source:
public void testIsNetworkInSyncWhenVlanIdDifferent ( ) throws java.lang.Exception { iface.setMtu ( 1 ) ; network.setMtu ( 1 ) ; iface.setVlanId ( 1 ) ; network.setVlanId ( 2 ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }

Target:
public void testIsNetworkInSyncWhenVlanIdDifferent ( ) { iface.setMtu ( 1 ) ; network.setMtu ( 1 ) ; iface.setVlanId ( 1 ) ; network.setVlanId ( 2 ) ; org.hamcrest.MatcherAssert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }
Source:
protected org.ovirt.engine.core.common.action.VdcReturnValueBase runAction ( org.ovirt.engine.core.bll.CommandBase < ? > command , boolean runAsInternal ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = evaluateCorrelationId ( command ) ; if ( returnValue != null ) { return returnValue ; } command.setInternalExecution ( runAsInternal ) ; executionHandler.prepareCommandForMonitoring ( command , command.getActionType ( ) , runAsInternal ) ; returnValue = actionExecutor.get ( ) . execute ( command ) ; returnValue.setCorrelationId ( command.getParameters ( ) . getCorrelationId ( ) ) ; returnValue.setJobId ( command.getJobId ( ) ) ; return returnValue ; }

Target:
protected org.ovirt.engine.core.common.action.ActionReturnValue runAction ( org.ovirt.engine.core.bll.CommandBase < ? > command , boolean runAsInternal ) { org.ovirt.engine.core.common.action.ActionReturnValue returnValue = evaluateCorrelationId ( command ) ; if ( returnValue != null ) { return returnValue ; } command.setInternalExecution ( runAsInternal ) ; executionHandler.prepareCommandForMonitoring ( command , command.getActionType ( ) , runAsInternal ) ; returnValue = actionExecutor.get ( ) . execute ( command ) ; returnValue.setCorrelationId ( command.getParameters ( ) . getCorrelationId ( ) ) ; returnValue.setJobId ( command.getJobId ( ) ) ; return returnValue ; }
Source:
public static void isClusterEmpty ( 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.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.lang.Boolean ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsClusterEmpty , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getRoleActionGroupsByRoleId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid roleId ) { 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.ActionGroup > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetRoleActionGroupsByRoleId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( roleId ) , aQuery ) ; }
Source:
protected void verifyRoot ( org.ovirt.engine.api.model.Tag root ) { org.junit.Assert.assertEquals ( Guid.Empty.toString ( ) , root.getId ( ) ) ; org.junit.Assert.assertEquals ( "root" , root.getName ( ) ) ; org.junit.Assert.assertEquals ( "root" , root.getDescription ( ) ) ; org.junit.Assert.assertNull ( root.getParent ( ) ) ; verifyLinks ( root ) ; }

Target:
protected void verifyRoot ( org.ovirt.engine.api.model.Tag root ) { org.junit.jupiter.api.Assertions.assertEquals ( Guid.Empty.toString ( ) , root.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( "root" , root.getName ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( "root" , root.getDescription ( ) ) ; org.junit.jupiter.api.Assertions.assertNull ( root.getParent ( ) ) ; verifyLinks ( root ) ; }
Source:
public static void GetClusterServerMemoryOverCommit ( 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.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommitForServers , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }

Target:
public static void GetStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.storage_server_connections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , false ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , false ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.Assert.assertNotNull ( wae.getResponse ( ) ) ; org.junit.Assert.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
public java.lang.String getNoun ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > op2 ) { assert ! ( isUnary ( ) ) : ( "The Unary Operation " + ( name ( ) ) ) + " has no Noun" ; if ( op2 == null ) { return org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . unassignedLogicalNetworksPanel ( ) ; } return op2.getName ( ) ; }

Target:
public java.lang.String getNoun ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > op2 ) { assert ! ( isUnary ( ) ) : ( "The Unary Operation " + ( name ( ) ) ) + " has no Noun" ; assert op2 != null : ( "Can't perform binary operation " + ( name ( ) ) ) + "without a second operand" ; return op2.getName ( ) ; }
Source:
protected org.ovirt.engine.core.bll.ValidationResult macAvailable ( ) { java.lang.Boolean allowDupMacs = org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.AllowDuplicateMacAddresses ) ; return ( org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getMacPool ( ) . isMacInUse ( getMacAddress ( ) ) ) && ( ! allowDupMacs ) ? new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_MAC_ADDRESS_IN_USE ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
protected org.ovirt.engine.core.bll.ValidationResult macAvailable ( ) { java.lang.Boolean allowDupMacs = org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.AllowDuplicateMacAddresses ) ; return ( org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getMacPool ( ) . isMacInUse ( getMacAddress ( ) ) ) && ( ! allowDupMacs ) ? new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_MAC_ADDRESS_IN_USE ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public static void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }

Target:
public static 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 < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( 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 void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { 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.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask getAsyncTask ( ) { org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask asyncTask = new org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask ( ) ; asyncTask.setStepId ( org.ovirt.engine.core.bll.gluster.GetGlusterVolumeRemoveBricksStatusQueryTest.STEP_ID ) ; asyncTask.setType ( GlusterTaskType.REBALANCE ) ; asyncTask.setStatus ( JobExecutionStatus.FINISHED ) ; asyncTask.setMessage ( "test_msg" ) ; asyncTask.setTaskId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; return asyncTask ; }

Target:
private org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask getAsyncTask ( ) { org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask asyncTask = new org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask ( ) ; asyncTask.setStepId ( org.ovirt.engine.core.bll.gluster.GetGlusterVolumeRemoveBricksStatusQueryTest.STEP_ID ) ; asyncTask.setType ( GlusterTaskType.REBALANCE ) ; asyncTask.setStatus ( JobExecutionStatus.FINISHED ) ; asyncTask.setMessage ( "test_msg" ) ; asyncTask.setTaskId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.asynctasks.gluster.GlusterTaskParameters params = new org.ovirt.engine.core.common.asynctasks.gluster.GlusterTaskParameters ( ) ; params.setVolumeName ( "volume1" ) ; asyncTask.setTaskParameters ( params ) ; return asyncTask ; }
Source:
public void lowThresholdStorageSpace ( ) { setupDiskSpaceTest ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateImages ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.when ( cmd.getImportValidator ( ) . validateSpaceRequirements ( org.mockito.ArgumentMatchers.anyCollection ( ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }

Target:
public void lowThresholdStorageSpace ( ) { setupDiskSpaceTest ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateImages ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.when ( cmd.getImportValidator ( ) . validateSpaceRequirements ( org.mockito.ArgumentMatchers.anyCollection ( ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) ; mockMemorySizeConfigValues ( org.ovirt.engine.core.compat.Version.getLast ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }
Source:
public javax.ws.rs.core.Response remove ( ) { get ( ) ; org.ovirt.engine.core.common.action.StoragePoolParametersBase params = new org.ovirt.engine.core.common.action.StoragePoolParametersBase ( asGuid ( id ) ) ; boolean force = org.ovirt.engine.api.common.util.ParametersHelper.getBooleanParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendDataCenterResource.FORCE , true , false ) ; if ( force ) { params.setForceDelete ( force ) ; } return performAction ( VdcActionType.RemoveStoragePool , params ) ; }

Target:
public javax.ws.rs.core.Response remove ( ) { get ( ) ; org.ovirt.engine.core.common.action.StoragePoolParametersBase params = new org.ovirt.engine.core.common.action.StoragePoolParametersBase ( asGuid ( id ) ) ; boolean force = org.ovirt.engine.api.restapi.util.ParametersHelper.getBooleanParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendDataCenterResource.FORCE , true , false ) ; if ( force ) { params.setForceDelete ( force ) ; } return performAction ( VdcActionType.RemoveStoragePool , params ) ; }
Source:
private void removeDiskImages ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > images = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( getVm ( ) . getDiskMap ( ) . values ( ) , true , false ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage image : images ) { image.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( getParameters ( ) . getStorageDomainId ( ) ) ) ) ; image.setStoragePoolId ( getParameters ( ) . getStoragePoolId ( ) ) ; } removeVmImages ( images ) ; }

Target:
private void removeDiskImages ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > images = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( getVm ( ) . getDiskMap ( ) . values ( ) , true , false ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage image : images ) { image.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.RemoveVmFromImportExportCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ) ; image.setStoragePoolId ( org.ovirt.engine.core.bll.RemoveVmFromImportExportCommand.getParameters ( ) . getStoragePoolId ( ) ) ; } removeVmImages ( images ) ; }
Source:
protected void setUpEntityQueryExpectations ( int times , java.lang.Object failure ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetNetworksByIscsiBondId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondNetworksResourceTest.ISCSI_BOND_ID } , getEntityList ( ) , failure ) ; } }

Target:
private static org.ovirt.engine.api.model.Network getModel ( int index ) { org.ovirt.engine.api.model.Network model = new org.ovirt.engine.api.model.Network ( ) ; model.setId ( GUIDS [ 0 ] . toString ( ) ) ; model.setName ( NAMES [ index ] ) ; model.setDescription ( DESCRIPTIONS [ index ] ) ; return model ; }
Source:
public static java.lang.String getMessage ( org.ovirt.engine.core.common.AuditLogType logType ) { final java.lang.String result = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.getMessageOrNull ( logType ) ; return result == null ? "" : result ; }

Target:
private static void checkMessages ( ) { org.ovirt.engine.core.common.AuditLogType [ ] values = org.ovirt.engine.core.common.AuditLogType.values ( ) ; if ( ( values.length ) != ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.messages.size ( ) ) ) { for ( org.ovirt.engine.core.common.AuditLogType value : values ) { if ( ! ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.messages.containsKey ( value ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.info ( "AuditLogType: '{}' not exist in string table" , value ) ; } } } }
Source:
private java.lang.String getSingleForm ( java.lang.String prefix ) { int startIndex = ( prefix.lastIndexOf ( '/' ) ) + 1 ; int endPos = ( prefix.endsWith ( "s" ) ) ? ( prefix.length ( ) ) - 1 : prefix.length ( ) ; return prefix.substring ( startIndex , endPos ) ; }

Target:
private java.lang.String getSingleForm ( java.lang.String prefix ) { int startIndex = ( prefix.lastIndexOf ( '/' ) ) + 1 ; prefix = prefix.substring ( startIndex ) ; if ( prefix.endsWith ( "ies" ) ) { return prefix.replaceAll ( "ies$" , "y" ) ; } if ( prefix.endsWith ( "s" ) ) { return prefix.replaceAll ( "s$" , "" ) ; } return prefix ; }
Source:
private void createSnapshotsForDisks ( ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage image : getDisksList ( ) ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = executeChildCommand ( image.getImageId ( ) ) ; if ( vdcReturnValue.getSucceeded ( ) ) { getTaskIdList ( ) . addAll ( vdcReturnValue.getInternalVdsmTaskIdList ( ) ) ; } else { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( vdcReturnValue.getFault ( ) . getError ( ) , "Failed to create snapshot!" ) ; } } }

Target:
private void createSnapshotsForDisks ( ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image : getDisksList ( ) ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.CreateSnapshot , buildCreateSnapshotParameters ( image ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContextForTasks ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getContext ( ) ) ) ; if ( vdcReturnValue.getSucceeded ( ) ) { getTaskIdList ( ) . addAll ( vdcReturnValue.getInternalVdsmTaskIdList ( ) ) ; } else { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( vdcReturnValue.getFault ( ) . getError ( ) , "Failed to create snapshot!" ) ; } } }
Source:
private static void auditLogPluginError ( java.lang.String pluginName , java.lang.String errorMessage ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase loggable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; loggable.addCustomValue ( "PluginName" , pluginName ) ; loggable.addCustomValue ( "ErrorMessage" , errorMessage ) ; org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerBrokerObjectBuilder.auditLogDirector.log ( loggable , AuditLogType.EXTERNAL_SCHEDULER_PLUGIN_ERROR ) ; }

Target:
private static void auditLogPluginError ( java.lang.String pluginName , java.lang.String errorMessage ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase loggable = org.ovirt.engine.core.di.Injector.injectMembers ( new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ) ; loggable.addCustomValue ( "PluginName" , pluginName ) ; loggable.addCustomValue ( "ErrorMessage" , errorMessage ) ; org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerBrokerObjectBuilder.auditLogDirector.log ( loggable , AuditLogType.EXTERNAL_SCHEDULER_PLUGIN_ERROR ) ; }
Source:
protected org.ovirt.engine.api.model.Templates mapCollection ( java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > entities ) { org.ovirt.engine.api.model.Templates collection = new org.ovirt.engine.api.model.Templates ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmTemplate entity : entities ) { collection.getTemplates ( ) . add ( addLinks ( map ( entity ) ) ) ; } return collection ; }

Target:
protected org.ovirt.engine.api.model.Templates mapCollection ( java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > entities ) { org.ovirt.engine.api.model.Templates collection = new org.ovirt.engine.api.model.Templates ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmTemplate entity : entities ) { collection.getTemplates ( ) . add ( addLinks ( populate ( map ( entity ) , entity ) ) ) ; } return collection ; }
Source:
public void testRemoveStorageDomainNull ( ) throws java.lang.Exception { control.replay ( ) ; try { resource.remove ( null ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertEquals ( 400 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveStorageDomainNull ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; setUriInfo ( uriInfo ) ; control.replay ( ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertEquals ( 400 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( getGeoRepSession ( ) ) == null ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_GEOREP_SESSION_INVALID ) ; return false ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = org.ovirt.engine.core.bll.gluster.GeoRepSessionCommandBase.getGlusterVolume ( ) ; if ( ! ( volume.isOnline ( ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_IS_DOWN ) ; addCanDoActionMessageVariable ( "volumeName" , volume.getName ( ) ) ; return false ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( getGeoRepSession ( ) ) == null ) { addCanDoActionMessage ( EngineMessage.ACTION_TYPE_FAILED_GEOREP_SESSION_INVALID ) ; return false ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = org.ovirt.engine.core.bll.gluster.GeoRepSessionCommandBase.getGlusterVolume ( ) ; if ( ! ( volume.isOnline ( ) ) ) { addCanDoActionMessage ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_IS_DOWN ) ; addCanDoActionMessageVariable ( "volumeName" , volume.getName ( ) ) ; return false ; } return true ; }
Source:
private void updateAvailableOvirtNodeUpgrades ( ) { final org.ovirt.engine.core.common.businessentities.VDS host = org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel.getSelectedItem ( ) ; if ( host == null ) { return ; } if ( ! ( host.isOvirtVintageNode ( ) ) ) { return ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getoVirtISOsList ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { } } ) , host.getId ( ) ) ; }

Target:
private void updateAvailableOvirtNodeUpgrades ( ) { final org.ovirt.engine.core.common.businessentities.VDS host = org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel.getSelectedItem ( ) ; if ( host == null ) { return ; } if ( ! ( host.isOvirtVintageNode ( ) ) ) { return ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getoVirtISOsList ( new org.ovirt.engine.ui.uicommonweb.models.hosts.AsyncQuery ( ) , host.getId ( ) ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.Permissions getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.Permissions permission = new org.ovirt.engine.core.common.businessentities.Permissions ( ) ; permission.setId ( GUIDS [ index ] ) ; permission.setAdElementId ( GUIDS [ 1 ] ) ; permission.setObjectId ( GUIDS [ 2 ] ) ; permission.setObjectType ( VdcObjectType.StoragePool ) ; permission.setRoleId ( GUIDS [ 3 ] ) ; return permission ; }

Target:
protected org.ovirt.engine.core.common.businessentities.Permissions getEntity ( int index ) { org.ovirt.engine.api.restapi.resource.Permissions permission = new org.ovirt.engine.api.restapi.resource.Permissions ( ) ; permission.setId ( GUIDS [ index ] ) ; permission.setAdElementId ( GUIDS [ 1 ] ) ; permission.setObjectId ( GUIDS [ 2 ] ) ; permission.setObjectType ( VdcObjectType.StoragePool ) ; permission.setRoleId ( GUIDS [ 3 ] ) ; return permission ; }
Source:
public void OnSuccess ( java.lang.Object model1 , java.lang.Object result ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel clusterModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel ) ( model1 ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumes = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > ) ( result ) ) ; if ( ( volumes.size ( ) ) > 0 ) { clusterModel.getEnableGlusterService ( ) . setIsChangable ( false ) ; } else { clusterModel.getEnableGlusterService ( ) . setIsChangable ( true ) ; } }

Target:
public void OnSuccess ( java.lang.Object model1 , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumes = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > ) ( result ) ) ; if ( ( volumes.size ( ) ) > 0 ) { clusterModel.getEnableGlusterService ( ) . setIsChangable ( false ) ; if ( ! isVirtGlusterAllowed ) { clusterModel.getEnableOvirtService ( ) . setIsChangable ( false ) ; } } }
Source:
public void testAddIscsiLunDiskIncompleteParametersConnectionPort ( ) { org.ovirt.engine.api.model.Disk model = createIscsiLunDisk ( ) ; model.getLunStorage ( ) . getLogicalUnits ( ) . getLogicalUnits ( ) . get ( 0 ) . setPort ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "LogicalUnit" , "testAddIscsiLunDiskIncompleteParametersConnectionPort" , "port" ) ; } }

Target:
public void testAddIscsiLunDiskIncompleteParametersConnectionPort ( ) { org.ovirt.engine.api.model.Disk model = createIscsiLunDisk ( ) ; model.getLunStorage ( ) . getLogicalUnits ( ) . getLogicalUnits ( ) . get ( 0 ) . setPort ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; verifyIncompleteException ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , ( ) -> org.ovirt.engine.api.restapi.resource.collection.add ( model ) ) , "LogicalUnit" , "lambda$testAddIscsiLunDiskIncompleteParametersConnectionPort$7" , "port" ) ; }
Source:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 ) ; org.ovirt.engine.api.model.DataCenter model = org.ovirt.engine.api.restapi.resource.BackendDataCentersResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }

Target:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 ) ; org.ovirt.engine.api.model.DataCenter model = org.ovirt.engine.api.restapi.resource.BackendDataCentersResourceTest.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 ) ; } }
Source:
private java.util.List < org.ovirt.engine.api.model.StorageType > getStorageTypes ( org.ovirt.engine.api.model.Version version ) { java.util.List < org.ovirt.engine.api.model.StorageType > ret = new java.util.ArrayList < org.ovirt.engine.api.model.StorageType > ( ) ; ret.add ( StorageType.ISCSI ) ; ret.add ( StorageType.FCP ) ; ret.add ( StorageType.NFS ) ; if ( localStorageEnabled ( version ) ) { ret.add ( StorageType.LOCALFS ) ; } if ( org.ovirt.engine.api.restapi.utils.VersionUtils.greaterOrEqual ( version , org.ovirt.engine.api.restapi.resource.BackendCapabilitiesResource.VERSION_3_1 ) ) { ret.add ( StorageType.POSIXFS ) ; } return ret ; }

Target:
private java.util.List < org.ovirt.engine.api.model.StorageType > getStorageTypes ( org.ovirt.engine.api.model.Version version ) { java.util.List < org.ovirt.engine.api.model.StorageType > ret = new java.util.ArrayList < org.ovirt.engine.api.model.StorageType > ( ) ; ret.add ( StorageType.ISCSI ) ; ret.add ( StorageType.FCP ) ; ret.add ( StorageType.NFS ) ; if ( org.ovirt.engine.api.restapi.utils.VersionUtils.greaterOrEqual ( version , org.ovirt.engine.api.restapi.resource.BackendCapabilitiesResource.VERSION_3_0 ) ) { ret.add ( StorageType.LOCALFS ) ; } if ( org.ovirt.engine.api.restapi.utils.VersionUtils.greaterOrEqual ( version , org.ovirt.engine.api.restapi.resource.BackendCapabilitiesResource.VERSION_3_1 ) ) { ret.add ( StorageType.POSIXFS ) ; } return ret ; }
Source:
public void isConnWithSameDetailsExistCheckSameConn ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newISCSIConnection = createISCSIConnection ( "1.2.3.4" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "3260" , "user1" , "mypassword123" ) ; org.mockito.Mockito.when ( command.findConnectionWithSameDetails ( newISCSIConnection ) ) . thenReturn ( newISCSIConnection ) ; boolean isExists = command.isConnWithSameDetailsExists ( newISCSIConnection , null ) ; org.junit.Assert.assertFalse ( isExists ) ; }

Target:
public void isConnWithSameDetailsExistCheckSameConn ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newISCSIConnection = createISCSIConnection ( "1.2.3.4" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "3260" , "user1" , "mypassword123" ) ; org.mockito.Mockito.when ( iscsiStorageHelper.findConnectionWithSameDetails ( newISCSIConnection ) ) . thenReturn ( newISCSIConnection ) ; boolean isExists = command.isConnWithSameDetailsExists ( newISCSIConnection , null ) ; org.junit.Assert.assertFalse ( isExists ) ; }
Source:
public void testParseSetActionWithValidArguments ( ) { parser.parse ( new java.lang.String [ ] { "-s" , "keyToSet=valueToSet" } ) ; org.junit.Assert.assertEquals ( ConfigActionType.ACTION_SET , parser.getConfigAction ( ) ) ; org.junit.Assert.assertEquals ( "keyToSet" , parser.getKey ( ) ) ; org.junit.Assert.assertEquals ( "valueToSet" , parser.getValue ( ) ) ; }

Target:
public void testParseSetActionWithValidArguments ( ) { parser.parse ( new java.lang.String [ ] { "-s" , "keyToSet=valueToSet" } ) ; org.junit.jupiter.api.Assertions.assertEquals ( ConfigActionType.ACTION_SET , parser.getConfigAction ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( "keyToSet" , parser.getKey ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( "valueToSet" , parser.getValue ( ) ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.qos.QosBase createQosEntity ( java.sql.ResultSet rs ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.qos.QosType qosType = org.ovirt.engine.core.common.businessentities.qos.QosType.forValue ( rs.getInt ( "qos_type" ) ) ; switch ( qosType ) { case STORAGE : return StorageQosDaoDbFacadeImpl.StorageDaoDbFacadaeImplMapper.MAPPER.createQosEntity ( rs ) ; case CPU : return CpuQosDaoDbFacadeImpl.CpuDaoDbFacadaeImplMapper.MAPPER.createQosEntity ( rs ) ; default : org.ovirt.engine.core.dao.qos.AllQosBaseDaoFacadeImpl.log.debugFormat ( "not handled/missing qos_type" , qosType ) ; break ; } return null ; }

Target:
protected org.ovirt.engine.core.common.businessentities.qos.QosBase createQosEntity ( java.sql.ResultSet rs ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.qos.QosType qosType = org.ovirt.engine.core.common.businessentities.qos.QosType.forValue ( rs.getInt ( "qos_type" ) ) ; switch ( qosType ) { case STORAGE : return StorageQosDaoDbFacadeImpl.StorageDaoDbFacadaeImplMapper.MAPPER.createQosEntity ( rs ) ; case CPU : return CpuQosDaoDbFacadeImpl.CpuDaoDbFacadaeImplMapper.MAPPER.createQosEntity ( rs ) ; case NETWORK : return NetworkQoSDaoFacadeImpl.NetworkQosDaoDbFacadaeImplMapper.MAPPER.createQosEntity ( rs ) ; default : org.ovirt.engine.core.dao.qos.AllQosBaseDaoFacadeImpl.log.debugFormat ( "not handled/missing qos_type" , qosType ) ; break ; } return null ; }
Source:
protected boolean validateImages ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > imagesToValidate = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVmId ( ) ) , true , false , true ) ; org.ovirt.engine.core.bll.validator.DiskImagesValidator diskImagesValidator = new org.ovirt.engine.core.bll.validator.DiskImagesValidator ( imagesToValidate ) ; return ( validate ( diskImagesValidator.diskImagesNotLocked ( ) ) ) && ( validate ( diskImagesValidator.diskImagesNotIllegal ( ) ) ) ; }

Target:
protected boolean validateImages ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > imagesToValidate = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVmId ( ) ) , true , false , true ) ; org.ovirt.engine.core.bll.validator.DiskImagesValidator diskImagesValidator = new org.ovirt.engine.core.bll.validator.DiskImagesValidator ( imagesToValidate ) ; return ( validate ( diskImagesValidator.diskImagesNotLocked ( ) ) ) && ( ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVm ( ) . isQualifiedForLiveSnapshotMerge ( ) ) || ( validate ( diskImagesValidator.diskImagesNotIllegal ( ) ) ) ) ; }
Source:
public void invalidClusterFirewallTypeForClusterVersion ( ) { org.mockito.Mockito.when ( cluster.getCompatibilityVersion ( ) ) . thenReturn ( Version.v3_6 ) ; org.mockito.Mockito.when ( cluster.getFirewallType ( ) ) . thenReturn ( FirewallType.FIREWALLD ) ; org.junit.Assert.assertThat ( validator.supportedFirewallTypeForClusterVersion ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.UNSUPPORTED_FIREWALL_TYPE_FOR_CLUSTER_VERSION ) ) ; }

Target:
public void invalidClusterFirewallTypeForClusterVersion ( ) { org.mockito.Mockito.when ( cluster.getCompatibilityVersion ( ) ) . thenReturn ( Version.v3_6 ) ; org.mockito.Mockito.when ( cluster.getFirewallType ( ) ) . thenReturn ( FirewallType.FIREWALLD ) ; org.hamcrest.MatcherAssert.assertThat ( validator.supportedFirewallTypeForClusterVersion ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.UNSUPPORTED_FIREWALL_TYPE_FOR_CLUSTER_VERSION ) ) ; }
Source:
public void networksUsedByATemplate ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network net = mockNetwork ( ) ; networksUsedTest ( net , false , true , org.junit.matchers.JUnitMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_PROVIDER_NETWORKS_USED ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.junit.matchers.JUnitMatchers.hasItem ( org.junit.matchers.JUnitMatchers.containsString ( net.getName ( ) ) ) ) ) ) ; }

Target:
public void networksUsedByATemplate ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network net = mockNetwork ( ) ; networksUsedTest ( net , false , true , org.hamcrest.CoreMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_PROVIDER_NETWORKS_USED ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.hamcrest.CoreMatchers.hasItem ( org.hamcrest.CoreMatchers.containsString ( net.getName ( ) ) ) ) ) ) ; }