auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void confFileConvertToMapFails ( ) throws java.io.IOException , java.net.URISyntaxException { givenListOfImagesAndVolumes ( ) ; givenTheWantedDiskImage ( ) ; mockVdcCommand ( VdcActionType.RetrieveImageData , successfulVdcReturnValue ( load ( "not-a-valid-hosted-engine-config-tar.tar" ) ) ) ; java.util.Map < java.lang.String , java.lang.String > config = fetchConfig ( ) ; verifyCalled ( VdcActionType.RetrieveImageData , org.mockito.Mockito.times ( 1 ) ) ; org.junit.Assert.assertThat ( config , org.hamcrest.core.Is.is ( java.util.Collections.emptyMap ( ) ) ) ; }

Target:
public void confFileConvertToMapFails ( ) throws java.io.IOException , java.net.URISyntaxException { givenListOfImagesAndVolumes ( ) ; givenTheWantedDiskImage ( ) ; mockVdcCommand ( ActionType.RetrieveImageData , successfulVdcReturnValue ( load ( "not-a-valid-hosted-engine-config-tar.tar" ) ) ) ; java.util.Map < java.lang.String , java.lang.String > config = fetchConfig ( ) ; verifyCalled ( ActionType.RetrieveImageData , org.mockito.Mockito.times ( 1 ) ) ; org.junit.Assert.assertThat ( config , org.hamcrest.core.Is.is ( java.util.Collections.emptyMap ( ) ) ) ; }
Source:
private boolean isLiveSnapshotApplicable ( ) { return ( ( ( ( getParameters ( ) . getParentCommand ( ) ) != ( org.ovirt.engine.core.common.action.VdcActionType.RunVm ) ) && ( ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) ) != null ) ) && ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) . isRunning ( ) ) ) && ( ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) . getRunOnVds ( ) ) != null ) ; }

Target:
private boolean isLiveSnapshotApplicable ( ) { return ( ( ( ( getParameters ( ) . getParentCommand ( ) ) != ( org.ovirt.engine.core.common.action.VdcActionType.RunVm ) ) && ( ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) ) != null ) ) && ( ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) . isRunning ( ) ) || ( ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) ) ) && ( ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) . getRunOnVds ( ) ) != null ) ; }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel storageListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel ) ( result.getState ( ) ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValueBase = result.getReturnValue ( ) ; storageListModel.storageDomain.setStorage ( ( ( java.lang.String ) ( vdcReturnValueBase.getActionReturnValue ( ) ) ) ) ; storageListModel.connection.setid ( ( ( java.lang.String ) ( vdcReturnValueBase.getActionReturnValue ( ) ) ) ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel storageListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel ) ( result.getState ( ) ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValueBase = result.getReturnValue ( ) ; storageListModel.storageDomain.setStorage ( ( ( java.lang.String ) ( vdcReturnValueBase.getActionReturnValue ( ) ) ) ) ; storageListModel.connection.setid ( ( ( java.lang.String ) ( vdcReturnValueBase.getActionReturnValue ( ) ) ) ) ; }
Source:
public void executeCommandWhenFailed ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( CLUSTER_ID , HOOK_ID ) ) ) ; setupMocks ( cmd ) ; mockBackend ( cmd , false ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.never ( ) ) . addServerHookInDb ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook.class ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_ENABLE_FAILED ) ; }

Target:
public void executeCommandWhenFailed ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( CLUSTER_ID , HOOK_ID ) ) ) ; setupMocks ( cmd ) ; mockBackendStatusChange ( cmd , false ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.never ( ) ) . addServerHookInDb ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook.class ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_ENABLE_FAILED ) ; }
Source:
private java.lang.String getVmPoolIsBeingCreatedMessage ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( EngineMessage.ACTION_TYPE_FAILED_VM_POOL_IS_BEING_CREATED.name ( ) ) ; if ( ( org.ovirt.engine.core.bll.AddVmPoolCommand.getVmPoolName ( ) ) != null ) { builder.append ( java.lang.String.format ( "$VmPoolName %1$s" , org.ovirt.engine.core.bll.AddVmPoolCommand.getVmPoolName ( ) ) ) ; } return builder.toString ( ) ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { return java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.AddVmPoolCommand.getParameters ( ) . getVmPool ( ) . getName ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.VM_POOL_NAME , new org.ovirt.engine.core.bll.LockMessage ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_POOL_IS_BEING_CREATED ) . withOptional ( "VmPoolName" , org.ovirt.engine.core.bll.AddVmPoolCommand.getVmPoolName ( ) ) ) ) ; }
Source:
public void testFindExternalMacAddresses ( ) { org.mockito.Mockito.when ( mockReadMacPool.isMacInRange ( org.ovirt.engine.core.bll.network.vm.ExternalVmMacsFinderTest.MAC_ADDRESS_1 ) ) . thenReturn ( java.lang.Boolean.TRUE ) ; org.mockito.Mockito.when ( mockReadMacPool.isMacInRange ( org.ovirt.engine.core.bll.network.vm.ExternalVmMacsFinderTest.MAC_ADDRESS_2 ) ) . thenReturn ( java.lang.Boolean.FALSE ) ; vm.setInterfaces ( java.util.Arrays.asList ( vNic1 , vNic2 ) ) ; final java.util.Set < java.lang.String > actual = underTest.findExternalMacAddresses ( vm ) ; org.junit.Assert.assertThat ( actual , org.hamcrest.Matchers.contains ( org.ovirt.engine.core.bll.network.vm.ExternalVmMacsFinderTest.MAC_ADDRESS_2 ) ) ; }

Target:
public void testFindExternalMacAddresses ( ) { org.mockito.Mockito.when ( mockReadMacPool.isMacInRange ( org.ovirt.engine.core.bll.network.vm.ExternalVmMacsFinderTest.MAC_ADDRESS_1 ) ) . thenReturn ( java.lang.Boolean.TRUE ) ; org.mockito.Mockito.when ( mockReadMacPool.isMacInRange ( org.ovirt.engine.core.bll.network.vm.ExternalVmMacsFinderTest.MAC_ADDRESS_2 ) ) . thenReturn ( java.lang.Boolean.FALSE ) ; vm.setInterfaces ( java.util.Arrays.asList ( vNic1 , vNic2 ) ) ; final java.util.Set < java.lang.String > actual = underTest.findExternalMacAddresses ( vm ) ; org.hamcrest.MatcherAssert.assertThat ( actual , org.hamcrest.Matchers.contains ( org.ovirt.engine.core.bll.network.vm.ExternalVmMacsFinderTest.MAC_ADDRESS_2 ) ) ; }
Source:
private void vdsExistWithHigherVersion ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setStatus ( VDSStatus.Up ) ; vds.setClusterCompatibilityVersion ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.VERSION_1_2 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList = new java.util.ArrayList < > ( ) ; vdsList.add ( vds ) ; org.mockito.Mockito.when ( vdsDao.getAllForCluster ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vdsList ) ; }

Target:
private void clusterHasVds ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setStatus ( VDSStatus.Up ) ; vds.setSupportedClusterLevels ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.VERSION_1_1.toString ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList = new java.util.ArrayList < > ( ) ; vdsList.add ( vds ) ; org.mockito.Mockito.when ( vdsDao.getAllForCluster ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( vdsList ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc registerSecrets ( java.util.Map < java.lang.String , java.lang.String > [ ] libvirtSecrets ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.registerSecrets" ) . withParameter ( "secrets" , libvirtSecrets ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc registerSecrets ( java.util.Map < java.lang.String , java.lang.String > [ ] libvirtSecrets , boolean clearUnusedSecrets ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.registerSecrets" ) . withParameter ( "secrets" , libvirtSecrets ) . withParameter ( "clear" , clearUnusedSecrets ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }
Source:
private org.ovirt.engine.core.compat.RpmVersion parseIsoFileVersion ( java.lang.String isoFileName , java.lang.String majorVersionStr ) { org.ovirt.engine.core.compat.RpmVersion isoVersion = null ; try { java.lang.String rpmLike = isoFileName.replaceFirst ( ( majorVersionStr + "-" ) , ( majorVersionStr + "." ) ) ; isoVersion = new org.ovirt.engine.core.compat.RpmVersion ( rpmLike , org.ovirt.engine.core.bll.GetoVirtISOsQuery.OVIRT_ISO_PREFIX , true ) ; isoVersion.setRpmName ( isoFileName ) ; } catch ( java.lang.RuntimeException e ) { log.errorFormat ( "Failed to extract RpmVersion for iso file {0} with major version {1} due to {2}" , isoFileName , majorVersionStr , org.apache.commons.lang.exception.ExceptionUtils.getMessage ( e ) ) ; } return isoVersion ; }

Target:
private org.ovirt.engine.core.compat.RpmVersion parseIsoFileVersion ( java.lang.String isoFileName , java.lang.String majorVersionStr ) { org.ovirt.engine.core.compat.RpmVersion isoVersion = null ; try { java.lang.String rpmLike = isoFileName.replaceFirst ( ( majorVersionStr + "-" ) , ( majorVersionStr + "." ) ) ; isoVersion = new org.ovirt.engine.core.compat.RpmVersion ( rpmLike , org.ovirt.engine.core.bll.GetoVirtISOsQuery.getOvirtIsoPrefix ( ) , true ) ; isoVersion.setRpmName ( isoFileName ) ; } catch ( java.lang.RuntimeException e ) { log.errorFormat ( "Failed to extract RpmVersion for iso file {0} with major version {1} due to {2}" , isoFileName , majorVersionStr , org.apache.commons.lang.exception.ExceptionUtils.getMessage ( e ) ) ; } return isoVersion ; }
Source:
public void testGetAllWithPermissionsPrivilegedUser ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > result = dao.getAll ( org.ovirt.engine.core.dao.PRIVILEGED_USER_ID , true ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; org.junit.Assert.assertTrue ( result.contains ( existingVm ) ) ; }

Target:
public void testGetAllWithPermissionsPrivilegedUser ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > result = dao.getAll ( org.ovirt.engine.core.dao.PRIVILEGED_USER_ID , true ) ; org.junit.jupiter.api.Assertions.assertNotNull ( result ) ; org.junit.jupiter.api.Assertions.assertFalse ( result.isEmpty ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( result.contains ( existingVm ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { if ( args.propertyName.equals ( object.ON_DISK_LOAD ) ) { addStorageQuotaColumn ( ) ; table.redraw ( ) ; diskTable.asEditor ( ) . edit ( object.getImportDiskListModel ( ) ) ; } else if ( args.propertyName.equals ( "Message" ) ) { message.setText ( object.getMessage ( ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { if ( args.propertyName.equals ( object.ON_DISK_LOAD ) ) { addStorageQuotaColumn ( ) ; table.redraw ( ) ; diskTable.asEditor ( ) . edit ( object.getImportDiskListModel ( ) ) ; } else if ( args.propertyName.equals ( "Message" ) ) { message.setText ( object.getMessage ( ) ) ; } else if ( args.propertyName.equals ( "InvalidVm" ) ) { table.redraw ( ) ; } }
Source:
private org.springframework.jdbc.core.namedparam.MapSqlParameterSource createBrickParams ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brick ) { return getCustomMapSqlParameterSource ( ) . addValue ( "id" , brick.getId ( ) ) . addValue ( "volume_id" , brick.getVolumeId ( ) ) . addValue ( "server_id" , brick.getServerId ( ) ) . addValue ( "brick_dir" , brick.getBrickDirectory ( ) ) . addValue ( "status" , org.ovirt.engine.core.common.utils.EnumUtils.nameOrNull ( brick.getStatus ( ) ) ) ; }

Target:
private org.springframework.jdbc.core.namedparam.MapSqlParameterSource createBrickParams ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brick ) { return getCustomMapSqlParameterSource ( ) . addValue ( "id" , brick.getId ( ) ) . addValue ( "volume_id" , brick.getVolumeId ( ) ) . addValue ( "server_id" , brick.getServerId ( ) ) . addValue ( "brick_dir" , brick.getBrickDirectory ( ) ) . addValue ( "brick_order" , ( ( brick.getBrickOrder ( ) ) == null ? 0 : brick.getBrickOrder ( ) ) ) . addValue ( "status" , org.ovirt.engine.core.common.utils.EnumUtils.nameOrNull ( brick.getStatus ( ) ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult glusterNetworkInUseAndUnset ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_NETWORK_INUSE ) . when ( ( ( ( ( cluster.supportsGlusterService ( ) ) && ( oldNetworkCluster.isGluster ( ) ) ) && ( ! ( networkCluster.isGluster ( ) ) ) ) && ( isGlusterNetworkInUse ( ) ) ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult glusterNetworkInUseAndUnset ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_NETWORK_INUSE ) . when ( ( ( ( ( cluster.supportsGlusterService ( ) ) && ( oldNetworkCluster.isGluster ( ) ) ) && ( ! ( networkCluster.isGluster ( ) ) ) ) && ( isGlusterNetworkInUse ( ) ) ) ) ; }
Source:
public void testBootProtocolSetForDisplayNetworkWhenNetworkIsNonDisplay ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network network = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; network.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.NONE , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForDisplayNetworkWhenNullValuedIpConfigurationAndWhenNetworkClusterDisplay ( false , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) , network , attachment ) ; }

Target:
private void doTestBootProtocolSetForRoleNetworkWhenNullValuedIpConfiguration ( boolean displayNetwork , org.ovirt.engine.core.common.businessentities.network.Network network , org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setIpConfiguration ( null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForRoleNetworkWhenNullValuedIpConfiguration ( displayNetwork , false , false , matcher , network , attachment ) ; }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > result = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . getAllForStorageDomain ( org.ovirt.engine.core.bll.storage.domain.GetStorageDomainListByIdQuery.getParameters ( ) . getId ( ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > temp = new java.util.ArrayList ( result ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : temp ) { if ( ( domain.getStorageDomainSharedStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus.Unattached ) ) { result.remove ( domain ) ; } } org.ovirt.engine.core.bll.storage.domain.GetStorageDomainListByIdQuery.getQueryReturnValue ( ) . setReturnValue ( result ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > result = storageDomainDao.getAllForStorageDomain ( org.ovirt.engine.core.bll.storage.domain.GetStorageDomainListByIdQuery.getParameters ( ) . getId ( ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > temp = new java.util.ArrayList ( result ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : temp ) { if ( ( domain.getStorageDomainSharedStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus.Unattached ) ) { result.remove ( domain ) ; } } org.ovirt.engine.core.bll.storage.domain.GetStorageDomainListByIdQuery.getQueryReturnValue ( ) . setReturnValue ( result ) ; }
Source:
public static void getDomainListViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean filterInternalDomain ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetDomainListParameters tempVar = new org.ovirt.engine.core.common.queries.GetDomainListParameters ( ) ; tempVar.setFilterInternalDomain ( filterInternalDomain ) ; org.ovirt.engine.ui.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetDomainList , tempVar , aQuery ) ; }

Target:
public static 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.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllTags , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.setUpTags ( ) , failure ) ; if ( failure == null ) { setUpEntityQueryExpectations ( VdcQueryType.GetRootTag , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.setUpRootTag ( ) ) ; } }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( QueryType.GetAllTags , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.setUpTags ( ) , failure ) ; if ( failure == null ) { setUpEntityQueryExpectations ( QueryType.GetRootTag , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.setUpRootTag ( ) ) ; } }
Source:
public void testBootProtocolSetForDisplayNetworkWhenBootProtocolIsDhcp ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network network = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; network.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.DHCP , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForDisplayNetworkWhenNullValuedIpConfigurationAndWhenNetworkClusterDisplay ( true , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) , network , attachment ) ; }

Target:
public void testBootProtocolSetForRoleNetworkWhenBootProtocolIsNone ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.NONE , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForRoleNetworkWhenNullValuedIpConfiguration ( false , true , true , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentValidator.VAR_ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL_ENTITY , network.getName ( ) ) ) , network , attachment ) ; }
Source:
public void canDoActionTemplateImageIsLocked ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Copy ) ; initTemplateDiskImage ( ) ; command.getImage ( ) . setImageStatus ( ImageStatus.LOCKED ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ) . when ( command ) . getTemplateForImage ( ) ; command.defineVmTemplate ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.VM_TEMPLATE_IMAGE_IS_LOCKED.toString ( ) ) ) ; }

Target:
public void canDoActionDiskIsOvfStore ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move , new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initVmDiskImage ( false ) ; command.getImage ( ) . setContentType ( DiskContentType.OVF_STORE ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.ACTION_TYPE_FAILED_OVF_DISK_NOT_SUPPORTED ) ; }
Source:
protected void perform ( ) { setActionReturnValue ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.ChangeDisk , new org.ovirt.engine.core.common.vdscommands.ChangeDiskVDSCommandParameters ( org.ovirt.engine.core.bll.ChangeDiskCommand.getVdsId ( ) , org.ovirt.engine.core.bll.ChangeDiskCommand.getVm ( ) . getId ( ) , cdImagePath ) ) . getReturnValue ( ) ) ; org.ovirt.engine.core.bll.ChangeDiskCommand.setSucceeded ( true ) ; }

Target:
protected void perform ( ) { setActionReturnValue ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.ChangeDisk , new org.ovirt.engine.core.common.vdscommands.ChangeDiskVDSCommandParameters ( org.ovirt.engine.core.bll.ChangeDiskCommand.getVdsId ( ) , org.ovirt.engine.core.bll.ChangeDiskCommand.getVm ( ) . getId ( ) , cdImagePath ) ) . getReturnValue ( ) ) ; updateCurrentCd ( ) ; org.ovirt.engine.core.bll.ChangeDiskCommand.setSucceeded ( true ) ; }
Source:
public void testUpdateFieldsName ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate src = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; src.setname ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; org.ovirt.engine.core.common.businessentities.VmTemplate dest = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; dest.setname ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; org.junit.Assert.assertTrue ( "Update should be valid for different names" , VmTemplateHandler.mUpdateVmTemplate.IsUpdateValid ( src , dest ) ) ; }

Target:
public void testUpdateFieldsName ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate src = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; src.setname ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; org.ovirt.engine.core.common.businessentities.VmTemplate dest = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; dest.setname ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; org.junit.Assert.assertTrue ( "Update should be valid for different names" , org.ovirt.engine.core.bll.VmTemplateHandler.isUpdateValid ( src , dest ) ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > getImagesList ( ) { if ( ( ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getImages ( ) ) == null ) && ( ! ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getDstSnapshotId ( ) . equals ( Guid.Empty ) ) ) ) { org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . setImages ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getDiskImageDao ( ) . getAllSnapshotsForVmSnapshot ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getDstSnapshotId ( ) ) ) ; } return org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getImages ( ) ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > getImagesList ( ) { if ( ( ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getImages ( ) ) == null ) && ( ! ( getSnapshotId ( ) . equals ( Guid.Empty ) ) ) ) { org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . setImages ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getDiskImageDao ( ) . getAllSnapshotsForVmSnapshot ( getSnapshotId ( ) ) ) ; } return org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getImages ( ) ; }
Source:
protected boolean canDoAction ( ) { disk = org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.getDiskDao ( ) . get ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.getParameters ( ) . getDiskId ( ) ) ; return ( ( ( ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.isVmExist ( ) ) && ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.isVmInUpPausedDownStatus ( ) ) ) && ( isDiskExist ( disk ) ) ) && ( checkCanPerformPlugUnPlugDisk ( ) ) ) && ( validate ( getSnapshotsValidator ( ) . vmNotDuringSnapshot ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.getVmId ( ) ) ) ) ; }

Target:
protected boolean canDoAction ( ) { disk = org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.getDiskDao ( ) . get ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.getParameters ( ) . getDiskId ( ) ) ; return ( ( ( ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.isVmExist ( ) ) && ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.isVmInUpPausedDownStatus ( ) ) ) && ( isDiskExist ( disk ) ) ) && ( checkCanPerformPlugUnPlugDisk ( ) ) ) && ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.isVmNotInPreviewSnapshot ( ) ) ; }
Source:
public void unmanagedVlanNetworkWithVmNetworkDenied ( ) { org.ovirt.engine.core.common.businessentities.network.Network net1 = createNetwork ( "net1" ) ; org.ovirt.engine.core.common.businessentities.network.Network net2 = createNetwork ( "net2" ) ; net2.setvlan_id ( 100 ) ; mockExistingNetworks ( net1 ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNicSyncedWithNetwork ( "nic0" , net1 ) ; mockExistingIfaces ( nic ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vlanNic = createVlan ( nic.getName ( ) , net2.getvlan_id ( ) , net2.getName ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic , vlanNic ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORK_INTERFACES_NOT_EXCLUSIVELY_USED_BY_NETWORK , nic.getName ( ) ) ; }

Target:
public void unmanagedVlanNetworkWithVmNetworkDenied ( ) { org.ovirt.engine.core.common.businessentities.network.Network net1 = createNetwork ( "net1" ) ; org.ovirt.engine.core.common.businessentities.network.Network net2 = createNetwork ( "net2" ) ; net2.setVlanId ( 100 ) ; mockExistingNetworks ( net1 ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNicSyncedWithNetwork ( "nic0" , net1 ) ; mockExistingIfaces ( nic ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vlanNic = createVlan ( nic.getName ( ) , net2.getVlanId ( ) , net2.getName ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic , vlanNic ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORK_INTERFACES_NOT_EXCLUSIVELY_USED_BY_NETWORK , nic.getName ( ) ) ; }
Source:
protected boolean canDoAction ( ) { return validate ( networkNotAttachedToCluster ( org.ovirt.engine.core.bll.network.dc.RemoveNetworkCommand.getNetwork ( ) ) ) ; }

Target:
protected boolean canDoAction ( ) { return ( ( ( ( validate ( networkExists ( getRemovedNetwork ( ) ) ) ) && ( validate ( notManagementNetwork ( ) ) ) ) && ( validate ( org.ovirt.engine.core.bll.network.dc.RemoveNetworkCommand.networkNotUsedByRunningVm ( ) ) ) ) && ( validate ( networkNotUsedByTemplates ( getRemovedNetwork ( ) ) ) ) ) && ( validate ( networkNotUsedByHost ( getRemovedNetwork ( ) ) ) ) ; }
Source:
public org.ovirt.engine.core.bll.SPMAsyncTask concreteCreateTask ( org.ovirt.engine.core.compat.Guid taskId , org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters p = new org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters ( asyncTaskCreationInfo , getAsyncTask ( taskId , asyncTaskCreationInfo , parentCommand ) ) ; p.setEntityInfo ( getParameters ( ) . getEntityInfo ( ) ) ; return createTask ( internalGetTaskType ( ) , p ) ; }

Target:
protected void setCommandStatus ( org.ovirt.engine.core.compat.CommandStatus status ) { this . commandStatus = status ; org.ovirt.engine.core.bll.tasks.TaskManagerUtil.updateCommandStatus ( getCommandId ( ) , getTaskType ( ) , commandStatus ) ; }
Source:
public static void getMaxVmMemSize ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean is64 ) { 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 source ; } return 262144 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( ( is64 ? org.ovirt.engine.core.common.queries.ConfigurationValues.VM64BitMaxMemorySizeInMB : org.ovirt.engine.core.common.queries.ConfigurationValues.VM32BitMaxMemorySizeInMB ) , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult profileValid ( org.ovirt.engine.core.compat.Guid clusterId ) { if ( ( nic.getVnicProfileId ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.network.VnicProfile vnicProfile = getVnicProfile ( ) ; if ( vnicProfile == null ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VNIC_PROFILE_NOT_EXISTS ) ; } org.ovirt.engine.core.common.businessentities.network.Network network = getNetworkByVnicProfile ( vnicProfile ) ; if ( ( network == null ) || ( ! ( isNetworkInCluster ( network , clusterId ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_NOT_EXISTS_IN_CURRENT_CLUSTER ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult profileValid ( org.ovirt.engine.core.compat.Guid clusterId ) { if ( ( nic.getVnicProfileId ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.network.VnicProfile vnicProfile = getVnicProfile ( ) ; if ( vnicProfile == null ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VNIC_PROFILE_NOT_EXISTS ) ; } org.ovirt.engine.core.common.businessentities.network.Network network = getNetworkByVnicProfile ( vnicProfile ) ; if ( ( network == null ) || ( ! ( isNetworkInCluster ( network , clusterId ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_NOT_EXISTS_IN_CURRENT_CLUSTER ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public boolean prepareConnectHostToStoragePoolServers ( org.ovirt.engine.core.common.action.ConnectHostToStoragePoolServersParameters parameters , java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > res = org.ovirt.engine.core.bll.storage.ISCSIStorageHelper.updateIfaces ( connections , parameters.getVds ( ) . getId ( ) ) ; connections.clear ( ) ; connections.addAll ( res ) ; return true ; }

Target:
public void prepareConnectHostToStoragePoolServers ( org.ovirt.engine.core.common.action.ConnectHostToStoragePoolServersParameters parameters , java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections ) { prepareStorageServer ( parameters , connections ) ; }
Source:
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.StorageServerConnections ) ( 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 ) ; }

Target:
public static 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.Permissions > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permissions > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }
Source:
protected abstract void processIncoming ( ) throws java.io.IOException , org.ovirt.vdsm.jsonrpc.client.ClientConnectionException ;

Target:
protected void processIncoming ( ) throws java.io.IOException , org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { if ( ( this . ibuff ) == null ) { this . ibuff = java.nio.ByteBuffer.allocate ( 16384 ) ; readBytes ( this . ibuff ) ; } else { readBytes ( this . ibuff ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig getHostNicVfsConfigToAdd ( org.ovirt.engine.core.common.businessentities.HostDevice device ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = hostNicVfsConfigHelper.getNicByPciDevice ( device ) ; if ( nic == null ) { return null ; } org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig hostNicVfsConfig = new org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig ( ) ; hostNicVfsConfig.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; hostNicVfsConfig.setNicId ( nic.getId ( ) ) ; hostNicVfsConfig.setAllNetworksAllowed ( true ) ; return hostNicVfsConfig ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig getHostNicVfsConfigToAdd ( org.ovirt.engine.core.common.businessentities.HostDevice device ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = hostNicVfsConfigHelper.getNicByPciDevice ( device , fetchedMap.values ( ) ) ; if ( nic == null ) { return null ; } org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig hostNicVfsConfig = new org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig ( ) ; hostNicVfsConfig.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; hostNicVfsConfig.setNicId ( nic.getId ( ) ) ; hostNicVfsConfig.setAllNetworksAllowed ( true ) ; return hostNicVfsConfig ; }
Source:
public void testCanDoAction ( ) { expectGetStoragePool ( STORAGE_POOL_ID ) ; expectGetStorageDomain ( STORAGE_DOMAIN_ID , STORAGE_POOL_ID , StorageDomainType.Data , StorageType.NFS ) ; expectGetVds ( VDS_ID ) ; expectGetIsoMap ( STORAGE_DOMAIN_ID ) ; expectBusinessEntitySnapshotDAO ( ) ; org.ovirt.engine.core.bll.storage.RemoveStorageDomainCommand < org.ovirt.engine.core.common.action.RemoveStorageDomainParameters > cmd = createCommand ( true ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; org.ovirt.engine.core.bll.CommandAssertUtils.checkSucceeded ( cmd , false ) ; org.ovirt.engine.core.bll.CommandAssertUtils.checkMessages ( cmd , VdcBllMessages.VAR__TYPE__STORAGE__DOMAIN , VdcBllMessages.VAR__ACTION__REMOVE ) ; }

Target:
public void testSetActionMessageParameters ( ) { org.ovirt.engine.core.bll.storage.RemoveStorageDomainCommand < org.ovirt.engine.core.common.action.RemoveStorageDomainParameters > cmd = createCommand ( true ) ; cmd.setActionMessageParameters ( ) ; org.ovirt.engine.core.bll.CommandAssertUtils.checkMessages ( cmd , VdcBllMessages.VAR__TYPE__STORAGE__DOMAIN , VdcBllMessages.VAR__ACTION__REMOVE ) ; }
Source:
public static void initBalloonSupportMap ( ) { 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 ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.balloonSupportMap = ( ( java.util.Map < java.lang.Integer , java.util.Map < org.ovirt.engine.core.compat.Version , java.lang.Boolean > > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetBalloonSupportMap ) , callback ) ; }

Target:
public void initBalloonSupportMap ( ) { 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 ) { balloonSupportMap = ( ( java.util.Map < java.lang.Integer , java.util.Map < org.ovirt.engine.core.compat.Version , java.lang.Boolean > > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetBalloonSupportMap ) , callback ) ; }
Source:
public void testConnection ( ) { try { getClient ( ) . execute ( new com.woorea.openstack.base.client.OpenStackRequest ( getClient ( ) , com.woorea.openstack.base.client.HttpMethod.GET , "" , null , null ) ) ; } catch ( com.woorea.openstack.base.client.OpenStackResponseException e ) { org.ovirt.engine.core.bll.provider.storage.AbstractOpenStackStorageProviderProxy.log.error ( "{} (OpenStack response error code: {})" , e.getMessage ( ) , e.getStatus ( ) ) ; org.ovirt.engine.core.bll.provider.storage.AbstractOpenStackStorageProviderProxy.log.debug ( "Exception" , e ) ; throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.PROVIDER_FAILURE , e ) ; } catch ( java.lang.RuntimeException e ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.PROVIDER_FAILURE , e ) ; } }

Target:
public void testConnection ( ) { try { getClient ( ) . execute ( new com.woorea.openstack.base.client.OpenStackRequest ( getClient ( ) , com.woorea.openstack.base.client.HttpMethod.GET , "" , null , null ) ) ; } catch ( com.woorea.openstack.base.client.OpenStackResponseException e ) { org.ovirt.engine.core.bll.provider.storage.AbstractOpenStackStorageProviderProxy.log.error ( "{} (OpenStack response error code: {})" , e.getMessage ( ) , e.getStatus ( ) ) ; org.ovirt.engine.core.bll.provider.storage.AbstractOpenStackStorageProviderProxy.log.debug ( "Exception" , e ) ; throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.PROVIDER_FAILURE , e ) ; } catch ( java.lang.RuntimeException e ) { throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.PROVIDER_FAILURE , e ) ; } }
Source:
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.StorageServerConnections ) ( source ) ) : null ; }

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.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; }
Source:
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.StoragePool > ( ) ; } final java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > storagePoolList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( source ) ) ; java.util.Collections.sort ( storagePoolList , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return source ; }

Target:
public void getDataCenterByClusterServiceList ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > > aQuery , boolean supportsVirtService , boolean supportsGlusterService ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.SortListByNameConverter < > ( ) ; final org.ovirt.engine.core.common.queries.GetStoragePoolsByClusterServiceParameters parameters = new org.ovirt.engine.core.common.queries.GetStoragePoolsByClusterServiceParameters ( ) ; parameters.setSupportsVirtService ( supportsVirtService ) ; parameters.setSupportsGlusterService ( supportsGlusterService ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolsByClusterService , parameters , aQuery ) ; }
Source:
public java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > mapDisks ( org.ovirt.engine.api.model.Disks disks ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > diskImages = null ; if ( ( disks != null ) && ( disks.isSetDisks ( ) ) ) { diskImages = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.api.model.Disk disk : disks.getDisks ( ) ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( org.ovirt.engine.api.restapi.types.DiskMapper.map ( disk , null ) ) ) ; diskImages.add ( diskImage ) ; } } return diskImages ; }

Target:
public java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > mapDisks ( org.ovirt.engine.api.model.Disks disks ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImages = null ; if ( ( disks != null ) && ( disks.isSetDisks ( ) ) ) { diskImages = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.api.model.Disk disk : disks.getDisks ( ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( org.ovirt.engine.api.restapi.types.DiskMapper.map ( disk , null ) ) ) ; diskImages.add ( diskImage ) ; } } return diskImages ; }
Source:
public void removeVmIdFromVfsNoOtherDeviceWithVmIdTest ( ) { removeVmIdFromVfsCommonTest ( 4 , 0 ) ; }

Target:
public void getFreeVfMoreThanOneFreeVf ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.HostDevice > freeVfs = freeVfCommon ( 5 , 2 , 2 , 2 , 2 ) ; org.junit.Assert.assertEquals ( 5 , freeVfs.size ( ) ) ; org.junit.Assert.assertTrue ( freeVfs.contains ( hostNicVfsConfigHelper.getFreeVf ( nic , null ) ) ) ; }