auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void canDoActionFailsForNoStorageDevice ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( HOST_ID , "brick1" , "/gluster-bricks/brick1" , org.ovirt.engine.core.common.businessentities.RaidType.RAID0 , null , null , java.util.Collections.< org.ovirt.engine.core.common.businessentities.gluster.StorageDevice > emptyList ( ) ) ) ) ; prepareMocks ( cmd , VDSStatus.Up ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; }

Target:
public void validateFailsForNoStorageDevice ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( HOST_ID , "brick1" , "/gluster-bricks/brick1" , org.ovirt.engine.core.common.businessentities.RaidType.RAID0 , null , null , java.util.Collections.< org.ovirt.engine.core.common.businessentities.gluster.StorageDevice > emptyList ( ) ) ) ) ; prepareMocks ( cmd , VDSStatus.Up ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }
Source:
public void testQueryWithNonExistingHostId ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getVdsId ( ) ) . thenReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; getQuery ( ) . setInternalExecution ( true ) ; getQuery ( ) . executeCommand ( ) ; org.ovirt.engine.core.bll.CommandAssertUtils.checkSucceeded ( getQuery ( ) , true ) ; org.ovirt.engine.core.bll.GetoVirtISOsTest.checkReturnValue ( getQuery ( ) ) ; }

Target:
public void testQueryWithNonExistingHostId ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getVdsId ( ) ) . thenReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; getQuery ( ) . setInternalExecution ( true ) ; getQuery ( ) . executeCommand ( ) ; org.ovirt.engine.core.bll.CommandAssertUtils.checkSucceeded ( getQuery ( ) , true ) ; org.ovirt.engine.core.bll.GetoVirtISOsTest.checkReturnValueEmpty ( getQuery ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.DisplayType extractSelectedDisplayTypeEntity ( ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.DisplayType > entityModel = getDisplayType ( ) . getSelectedItem ( ) ; if ( entityModel == null ) { return null ; } return entityModel.getEntity ( ) ; }

Target:
protected java.lang.String getIconToShow ( java.lang.String currentOsDefaultIcon ) { if ( ( getIcon ( ) . getEntity ( ) ) == null ) { return currentOsDefaultIcon ; } return getIcon ( ) . getEntity ( ) . isCustom ( ) ? getIcon ( ) . getEntity ( ) . getIcon ( ) : currentOsDefaultIcon ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getFilteredDisksForSnapshot ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > filteredDisksForSnapshot = getDiskImagesForVm ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > cinderDisks = org.ovirt.engine.core.bll.ImagesHandler.filterDisksBasedOnCinder ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmId ( ) ) ) ; filteredDisksForSnapshot.addAll ( cinderDisks ) ; return filteredDisksForSnapshot ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getDisksList ( ) { if ( ( cachedSelectedActiveDisks ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > imagesAndCinderForVm = getDiskImagesForVm ( ) ; if ( ( getParameters ( ) . getDisks ( ) ) == null ) { cachedSelectedActiveDisks = imagesAndCinderForVm ; } else { cachedSelectedActiveDisks = org.ovirt.engine.core.bll.ImagesHandler.imagesIntersection ( imagesAndCinderForVm , getParameters ( ) . getDisks ( ) ) ; } } return cachedSelectedActiveDisks ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; vmAndTemplatesGenerationsDao = dbFacade.getVmAndTemplatesGenerationsDao ( ) ; }

Target:
public void testDeleteOvfGenerations ( ) { java.util.List < org.ovirt.engine.core.compat.Guid > vmsGuids = new java.util.LinkedList < > ( ) ; vmsGuids.add ( FixturesTool.VM_RHEL5_POOL_50 ) ; vmsGuids.add ( FixturesTool.VM_RHEL5_POOL_51 ) ; vmDao.remove ( FixturesTool.VM_RHEL5_POOL_50 ) ; vmDao.remove ( FixturesTool.VM_RHEL5_POOL_51 ) ; vmAndTemplatesGenerationsDao.deleteOvfGenerations ( vmsGuids ) ; java.lang.Long value = vmAndTemplatesGenerationsDao.getOvfGeneration ( FixturesTool.VM_RHEL5_POOL_50 ) ; org.junit.Assert.assertNull ( "ovf generation wasn't deleted succesfully" , value ) ; value = vmAndTemplatesGenerationsDao.getOvfGeneration ( FixturesTool.VM_RHEL5_POOL_51 ) ; org.junit.Assert.assertNull ( "ovf generation wasn't deleted succesfully" , value ) ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 ) ; setGetVmQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmInterface , org.ovirt.engine.core.common.action.RemoveVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "InterfaceId" } , new java.lang.Object [ ] { PARENT_ID , GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 ) ; setGetVmQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setGetGuestAgentQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmInterface , org.ovirt.engine.core.common.action.RemoveVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "InterfaceId" } , new java.lang.Object [ ] { PARENT_ID , GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) ) ) ; }
Source:
public void testAnotherInterfaceAlreadyLabeledWithThisLabel ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createVdsNetworkInterfaceWithName ( "name" ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface preexistingVdsNetworkInterface = createVdsNetworkInterfaceWithName ( "differentName" ) ; java.lang.String label = "label" ; vdsNetworkInterface.setLabels ( java.util.Collections.singleton ( label ) ) ; preexistingVdsNetworkInterface.setLabels ( java.util.Collections.singleton ( label ) ) ; org.ovirt.engine.core.bll.validator.HostInterfaceValidator validator = new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( vdsNetworkInterface ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > preexistingInterfaces = java.util.Collections.singletonList ( preexistingVdsNetworkInterface ) ; org.junit.Assert.assertThat ( "different nics cannot have same label set." , validator.anotherInterfaceAlreadyLabeledWithThisLabel ( label , preexistingInterfaces ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.OTHER_INTERFACE_ALREADY_LABELED ) ) ; }

Target:
public void testAnotherInterfaceAlreadyLabeledWithThisLabel ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createVdsNetworkInterfaceWithName ( "name" ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface preexistingVdsNetworkInterface = createVdsNetworkInterfaceWithName ( "differentName" ) ; java.lang.String label = "label" ; vdsNetworkInterface.setLabels ( java.util.Collections.singleton ( label ) ) ; preexistingVdsNetworkInterface.setLabels ( java.util.Collections.singleton ( label ) ) ; org.ovirt.engine.core.bll.validator.HostInterfaceValidator validator = new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( vdsNetworkInterface ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > preexistingInterfaces = java.util.Collections.singletonList ( preexistingVdsNetworkInterface ) ; org.junit.Assert.assertThat ( "different nics cannot have same label set." , validator.anotherInterfaceAlreadyLabeledWithThisLabel ( label , preexistingInterfaces ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.OTHER_INTERFACE_ALREADY_LABELED ) ) ; }
Source:
public void readData ( java.io.ObjectInputStream dis ) { synchronized ( ovirt_engine_dwh.aggregationtohourly_3_4.AggregationToHourly.row11Struct.commonByteArrayLock_OVIRT_ENGINE_DWH_AggregationToHourly ) { try { int length = 0 ; this . var_name = readString ( dis ) ; this . var_value = readString ( dis ) ; this . var_datetime = readDate ( dis ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } } }

Target:
public void readData ( java.io.ObjectInputStream dis ) { synchronized ( ovirt_engine_dwh.aggregationtohourly_3_4.AggregationToHourly.row11Struct.commonByteArrayLock_OVIRT_ENGINE_DWH_AggregationToHourly ) { try { int length = 0 ; this . key = readString ( dis ) ; this . value = readString ( dis ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } } }
Source:
public void getVnicProfilesByNetworkId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid networkId ) { 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.network.VnicProfileView > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByNetworkId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( networkId ) , aQuery ) ; }

Target:
public void getVmGuestAgentInterfacesByVmId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.dal.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb ) { if ( ( ( getVm ( ) . getrun_on_vds ( ) ) != null ) && ( getVm ( ) . getrun_on_vds ( ) . equals ( vds.getId ( ) ) ) ) { sb.append ( "is the same host the VM is currently running on" ) ; return org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_MIGRATION_TO_SAME_HOST ; } return null ; }

Target:
public org.ovirt.engine.core.dal.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate ) { if ( isMigrate && ( ( ( getVm ( ) . getrun_on_vds ( ) ) != null ) && ( getVm ( ) . getrun_on_vds ( ) . equals ( vds.getId ( ) ) ) ) ) { sb.append ( "is the same host the VM is currently running on" ) ; return org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_MIGRATION_TO_SAME_HOST ; } return null ; }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { }

Target:
private void Commit ( ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getEntity ( ) ) ) ; if ( vm != null ) { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = getInPreview ( ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.RestoreAllSnapshots , new org.ovirt.engine.core.common.action.RestoreAllSnapshotsParameters ( vm.getId ( ) , snapshot.getId ( ) ) , null , null ) ; } }
Source:
private org.ovirt.engine.core.compat.Guid addDisk ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk ) { org.ovirt.engine.core.common.action.ActionReturnValue returnValue = getBackend ( ) . runInternalAction ( ActionType.AddDisk , buildAddDiskParameters ( disk ) , enclosingCommand.getContext ( ) . clone ( ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.EngineException ( returnValue.getFault ( ) . getError ( ) , java.lang.String.format ( "Failed to create disk! %s" , disk.getDiskAlias ( ) ) ) ; } return returnValue.getActionReturnValue ( ) ; }

Target:
private org.ovirt.engine.core.compat.Guid addDisk ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk ) { org.ovirt.engine.core.common.action.ActionReturnValue returnValue = org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.bll.interfaces.BackendInternal.class ) . runInternalAction ( ActionType.AddDisk , buildAddDiskParameters ( disk ) , enclosingCommand.getContext ( ) . clone ( ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.EngineException ( returnValue.getFault ( ) . getError ( ) , java.lang.String.format ( "Failed to create disk! %s" , disk.getDiskAlias ( ) ) ) ; } return returnValue.getActionReturnValue ( ) ; }
Source:
public int compare ( org.ovirt.engine.core.common.businessentities.network.VnicProfileView vnicProfile1 , org.ovirt.engine.core.common.businessentities.network.VnicProfileView vnicProfile2 ) { if ( vnicProfile1 == null ) { return vnicProfile2 == null ? 0 : 1 ; } else if ( vnicProfile2 == null ) { return - 1 ; } int retVal = lexoNumeric.compare ( vnicProfile1.getNetworkName ( ) , vnicProfile2.getNetworkName ( ) ) ; return retVal == 0 ? lexoNumeric.compare ( vnicProfile1.getName ( ) , vnicProfile2.getName ( ) ) : retVal ; }

Target:
public int compare ( org.ovirt.engine.core.common.businessentities.network.VnicProfileView vnicProfile1 , org.ovirt.engine.core.common.businessentities.network.VnicProfileView vnicProfile2 ) { if ( vnicProfile1 == ( org.ovirt.engine.core.common.businessentities.network.VnicProfileView.EMPTY ) ) { return vnicProfile2 == ( org.ovirt.engine.core.common.businessentities.network.VnicProfileView.EMPTY ) ? 0 : 1 ; } else if ( vnicProfile2 == ( org.ovirt.engine.core.common.businessentities.network.VnicProfileView.EMPTY ) ) { return - 1 ; } int retVal = lexoNumeric.compare ( vnicProfile1.getNetworkName ( ) , vnicProfile2.getNetworkName ( ) ) ; return retVal == 0 ? lexoNumeric.compare ( vnicProfile1.getName ( ) , vnicProfile2.getName ( ) ) : retVal ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult networkMappingsProvided ( java.lang.String networkMappings ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.ACTION_TYPE_FAILED_MISSING_NETWORK_MAPPINGS ) . when ( ( ( org.apache.commons.lang.StringUtils.isBlank ( networkMappings ) ) && ( ( ( getAgentConfiguration ( ) ) == null ) || ( org.apache.commons.lang.StringUtils.isBlank ( getAgentConfiguration ( ) . getNetworkMappings ( ) ) ) ) ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult networkMappingsProvided ( java.lang.String networkMappings ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.ACTION_TYPE_FAILED_MISSING_NETWORK_MAPPINGS ) . when ( ( ( org.apache.commons.lang.StringUtils.isBlank ( networkMappings ) ) && ( ( ( getAgentConfiguration ( ) ) == null ) || ( org.apache.commons.lang.StringUtils.isBlank ( getAgentConfiguration ( ) . getNetworkMappings ( ) ) ) ) ) ) ; }
Source:
public void testValidateModifiedBondSlavesWhenSlaveInterfaceDoesNotExist ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ; params.setBonds ( java.util.Collections.singletonList ( bond ) ) ; doTestValidateModifiedBondSlaves ( params , null , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > emptyList ( ) , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.Network > emptyList ( ) , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.HOST_NETWORK_INTERFACE_NOT_EXIST ) , ValidationResult.VALID , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.HOST_NETWORK_INTERFACE_NOT_EXIST ) ) ; }

Target:
public void testValidateModifiedBondSlavesWhenSlaveInterfaceDoesNotExist ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ; params.setBonds ( java.util.Collections.singletonList ( bond ) ) ; doTestValidateModifiedBondSlaves ( params , null , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > emptyList ( ) , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.Network > emptyList ( ) , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) , ValidationResult.VALID , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) ) ; }
Source:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.hosts.MoveHost object ) { if ( ! ( object.isMultiSelection ( ) ) ) table.setSelectionModel ( new com.google.gwt.view.client.SingleSelectionModel < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ) ; driver.edit ( object ) ; table.edit ( object ) ; }

Target:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.hosts.MoveHost object ) { if ( ! ( object.isMultiSelection ( ) ) ) table.setSelectionModel ( new com.google.gwt.view.client.SingleSelectionModel < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ) ; driver.edit ( object ) ; table.asEditor ( ) . edit ( object ) ; }
Source:
public java.lang.Object runInTransaction ( ) { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap mapToRemove = getStorageDomain ( ) . getStoragePoolIsoMapData ( ) ; getCompensationContext ( ) . snapshotEntity ( mapToRemove ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolIsoMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( mapToRemove.getstorage_id ( ) , mapToRemove.getstorage_pool_id ( ) ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Object runInTransaction ( ) { detachStorageDomainWithEntities ( getStorageDomain ( ) ) ; org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap mapToRemove = getStorageDomain ( ) . getStoragePoolIsoMapData ( ) ; getCompensationContext ( ) . snapshotEntity ( mapToRemove ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolIsoMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( mapToRemove.getstorage_id ( ) , mapToRemove.getstorage_pool_id ( ) ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ( vm.getVmPoolId ( ) ) == null ) { org.ovirt.engine.ui.webadmin.widget.table.column.VmTypeConfig config = org.ovirt.engine.ui.webadmin.widget.table.column.VmTypeConfig.from ( vm.getVmType ( ) , vm.isStateless ( ) , vm.isNextRunConfigurationExists ( ) ) ; return config.getImageResource ( ) ; } else { return org.ovirt.engine.ui.webadmin.widget.table.column.VmTypeColumn.getPoolVmImageResource ( vm.getVmType ( ) , vm.isNextRunConfigurationExists ( ) ) ; } }

Target:
public com.google.gwt.safehtml.shared.SafeHtml getValue ( org.ovirt.engine.core.common.businessentities.VM vm ) { return org.ovirt.engine.ui.webadmin.widget.table.column.VmTypeColumn.getRenderedValue ( vm ) ; }
Source:
private void validateDataUrlFormat ( java.lang.String dataUrl ) { final java.lang.String dataUrlRegex = "^data:(\\w+/\\w+);base64,([\\w+/]+={0,2})$" ; final java.util.regex.Matcher matcher = java.util.regex.Pattern.compile ( dataUrlRegex ) . matcher ( dataUrl ) ; final boolean matches = matcher.find ( ) ; if ( ! matches ) { validationResult = new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.VM_ICON_DATAURL_MALFORMED ) ; return ; } mimeType = matcher.group ( 1 ) ; base64Data = matcher.group ( 2 ) ; }

Target:
private void validateDataUrlFormat ( java.lang.String dataUrl ) { final java.lang.String dataUrlRegex = "^data:(\\w+/\\w+);base64,([\\w+/]+={0,2})$" ; final java.util.regex.Matcher matcher = java.util.regex.Pattern.compile ( dataUrlRegex ) . matcher ( dataUrl ) ; final boolean matches = matcher.find ( ) ; if ( ! matches ) { validationResult = new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.VM_ICON_DATAURL_MALFORMED ) ; return ; } mimeType = matcher.group ( 1 ) ; base64Data = matcher.group ( 2 ) ; }
Source:
protected org.ovirt.engine.api.model.Snapshot doPopulate ( org.ovirt.engine.api.model.Snapshot model , org.ovirt.engine.api.model.Snapshot entity ) { return model ; }

Target:
private org.ovirt.engine.api.model.Snapshot populateSnapshotConfiguration ( org.ovirt.engine.api.model.Snapshot model ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryReturnValue = runQuery ( VdcQueryType.GetVmOvfConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( model.getId ( ) ) ) ) ; if ( ( queryReturnValue.getSucceeded ( ) ) && ( ( queryReturnValue.getReturnValue ( ) ) != null ) ) { return org.ovirt.engine.api.restapi.types.SnapshotMapper.mapSnapshotConfiguration ( ( ( java.lang.String ) ( queryReturnValue.getReturnValue ( ) ) ) , ConfigurationType.OVF , model ) ; } return model ; }
Source:
private static boolean isQosInSync ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , org.ovirt.engine.core.common.businessentities.network.HostNetworkQos networkQos ) { org.ovirt.engine.core.common.businessentities.network.HostNetworkQos ifaceQos = iface.getQos ( ) ; return org.ovirt.engine.core.utils.NetworkUtils.qosParametersEqual ( ifaceQos , networkQos ) ; }

Target:
public static boolean qosConfiguredOnInterface ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , org.ovirt.engine.core.common.businessentities.network.Network network ) { if ( iface.isQosOverridden ( ) ) { return ( ( iface.getQos ( ) ) != null ) && ( ! ( iface.getQos ( ) . isEmpty ( ) ) ) ; } else { return ( network != null ) && ( ( network.getQosId ( ) ) != null ) ; } }
Source:
public void testCreateAndGetById ( ) { org.ovirt.engine.core.compat.Guid guid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.Label label = new org.ovirt.engine.core.common.businessentities.LabelBuilder ( ) . name ( "test label" ) . id ( guid ) . build ( ) ; dao.save ( label ) ; org.ovirt.engine.core.common.businessentities.Label read = dao.get ( guid ) ; org.junit.Assert.assertNotNull ( read ) ; org.junit.Assert.assertEquals ( guid , read.getId ( ) ) ; org.junit.Assert.assertEquals ( label.getName ( ) , read.getName ( ) ) ; }

Target:
public void testCreateAndGetById ( ) { org.ovirt.engine.core.compat.Guid guid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.Label label = new org.ovirt.engine.core.common.businessentities.LabelBuilder ( ) . name ( "test label" ) . id ( guid ) . build ( ) ; dao.save ( label ) ; org.ovirt.engine.core.common.businessentities.Label read = dao.get ( guid ) ; org.junit.jupiter.api.Assertions.assertNotNull ( read ) ; org.junit.jupiter.api.Assertions.assertEquals ( guid , read.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( label.getName ( ) , read.getName ( ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepStatus ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > response ; response = vdsServer.glusterVolumeGeoRepStatus ( volumeName , slaveHost , slaveVolumeName ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepSessionList ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > response ; response = vdsServer.glusterVolumeGeoRepSessionList ( volumeName , slaveHost , slaveVolumeName ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void testSync ( ) { org.mockito.Mockito.doReturn ( getSessionsVDSReturnVal ( true , 2 ) ) . when ( syncJob ) . runVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.GetGlusterVolumeGeoRepStatus ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters.class ) ) ; syncJob.refreshGeoRepData ( ) ; org.mockito.Mockito.verify ( geoRepDao , org.mockito.Mockito.times ( 2 ) ) . save ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession.class ) ) ; }

Target:
public void testDiscoverGeoRepDataWhenNoSessions ( ) { org.mockito.Mockito.doReturn ( getSessionsVDSReturnVal ( true , 0 ) ) . when ( syncJob ) . runVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.GetGlusterVolumeGeoRepStatus ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters.class ) ) ; syncJob.discoverGeoRepData ( ) ; org.mockito.Mockito.verify ( geoRepDao , org.mockito.Mockito.times ( 0 ) ) . save ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession.class ) ) ; }
Source:
protected boolean canDoAction ( ) { return org.ovirt.engine.core.bll.RemoveAdGroupCommand.CanRemoveAdGroup ( org.ovirt.engine.core.bll.RemoveAdGroupCommand.getParameters ( ) . getAdElementId ( ) , org.ovirt.engine.core.bll.RemoveAdGroupCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.compat.Guid groupId = org.ovirt.engine.core.bll.RemoveAdGroupCommand.getParameters ( ) . getAdElementId ( ) ; java.util.List < java.lang.String > reasons = org.ovirt.engine.core.bll.RemoveAdGroupCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ; boolean returnValue = true ; if ( isLastSuperUserGroup ( groupId ) ) { returnValue = false ; reasons.add ( VdcBllMessages.ERROR_CANNOT_REMOVE_LAST_SUPER_USER_ROLE.toString ( ) ) ; } if ( groupId.equals ( MultiLevelAdministrationHandler.EVERYONE_OBJECT_ID ) ) { returnValue = false ; reasons.add ( VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_REMOVE_BUILTIN_GROUP_EVERYONE.name ( ) ) ; } return returnValue ; }
Source:
public static void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }

Target:
public static void countAllTemplates ( 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplateCount , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult validateNotRemovingUsedNetworkByVms ( ) { java.util.Collection < java.lang.String > removedNetworks = new java.util.HashSet < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment removedAttachment : removedNetworkAttachments ) { removedNetworks.add ( existingNetworkRelatedToAttachment ( removedAttachment ) . getName ( ) ) ; } java.util.List < java.lang.String > vmNames = getVmInterfaceManager ( ) . findActiveVmsUsingNetworks ( host.getId ( ) , removedNetworks ) ; if ( vmNames.isEmpty ( ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } else { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_CANNOT_DETACH_NETWORK_USED_BY_VMS , commaSeparated ( vmNames ) ) ; } }

Target:
org.ovirt.engine.core.bll.ValidationResult validateNotRemovingUsedNetworkByVms ( ) { java.util.Collection < java.lang.String > removedNetworks = new java.util.HashSet < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment removedAttachment : removedNetworkAttachments ) { removedNetworks.add ( existingNetworkRelatedToAttachment ( removedAttachment ) . getName ( ) ) ; } java.util.List < java.lang.String > vmNames = getVmInterfaceManager ( ) . findActiveVmsUsingNetworks ( host.getId ( ) , removedNetworks ) ; if ( vmNames.isEmpty ( ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } else { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_CANNOT_DETACH_NETWORK_USED_BY_VMS , commaSeparated ( vmNames ) ) ; } }
Source:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { if ( "OS" . equals ( fieldName ) ) { return new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.VmOsType.class ) ; } else if ( "CREATIONDATE" . equals ( fieldName ) ) { return new org.ovirt.engine.core.searchbackend.DateEnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.DateEnumForSearch.class ) ; } else if ( "STATUS" . equals ( fieldName ) ) { return new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.VmTemplateStatus.class ) ; } else if ( "QUOTA" . equals ( fieldName ) ) { return new org.ovirt.engine.core.searchbackend.NullableStringAutoCompleter ( ) ; } return null ; }

Target:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { if ( "OS" . equals ( fieldName ) ) { return org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . get ( org.ovirt.engine.core.searchbackend.OsValueAutoCompleter.class ) ; } else if ( "CREATIONDATE" . equals ( fieldName ) ) { return new org.ovirt.engine.core.searchbackend.DateEnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.DateEnumForSearch.class ) ; } else if ( "STATUS" . equals ( fieldName ) ) { return new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.VmTemplateStatus.class ) ; } else if ( "QUOTA" . equals ( fieldName ) ) { return new org.ovirt.engine.core.searchbackend.NullableStringAutoCompleter ( ) ; } return null ; }
Source:
public void successfulFenceWith1stError2ndSuccess ( ) { mockFenceAgents ( ) ; mockFenceResult ( agentExecutor1 , new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.ERROR , org.ovirt.engine.core.common.businessentities.pm.PowerStatus.UNKNOWN ) ) ; mockFenceResult ( agentExecutor2 , new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.SUCCESS , org.ovirt.engine.core.common.businessentities.pm.PowerStatus.ON ) ) ; org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult result = executor.fence ( FenceActionType.STATUS ) ; org.junit.Assert.assertEquals ( Status.SUCCESS , result.getStatus ( ) ) ; org.junit.Assert.assertEquals ( PowerStatus.ON , result.getPowerStatus ( ) ) ; }

Target:
public void successfulFenceWith1stError2ndSuccess ( ) { mockFenceAgents ( ) ; mockFenceResult ( agentExecutor1 , new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.ERROR , org.ovirt.engine.core.common.businessentities.pm.PowerStatus.UNKNOWN ) ) ; mockFenceResult ( agentExecutor2 , new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.SUCCESS , org.ovirt.engine.core.common.businessentities.pm.PowerStatus.ON ) ) ; org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult result = executor.fence ( FenceActionType.STATUS ) ; org.junit.jupiter.api.Assertions.assertEquals ( Status.SUCCESS , result.getStatus ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( PowerStatus.ON , result.getPowerStatus ( ) ) ; }
Source:
public void removeMemoryFromSnapshot ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = dao.get ( org.ovirt.engine.core.dao.SnapshotDaoTest.EXISTING_SNAPSHOT_ID2 ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.SnapshotDaoTest.EXISTING_MEMORY_VOLUME , snapshot.getMemoryVolume ( ) ) ; dao.removeMemoryFromSnapshot ( org.ovirt.engine.core.dao.SnapshotDaoTest.EXISTING_SNAPSHOT_ID2 ) ; snapshot = dao.get ( org.ovirt.engine.core.dao.SnapshotDaoTest.EXISTING_SNAPSHOT_ID2 ) ; org.junit.Assert.assertEquals ( StringUtils.EMPTY , snapshot.getMemoryVolume ( ) ) ; }

Target:
public void removeMemoryFromActiveSnapshot ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = dao.get ( org.ovirt.engine.core.dao.SnapshotDaoTest.EXISTING_SNAPSHOT_ID2 ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.SnapshotDaoTest.EXISTING_MEMORY_VOLUME , snapshot.getMemoryVolume ( ) ) ; dao.removeMemoryFromActiveSnapshot ( org.ovirt.engine.core.dao.SnapshotDaoTest.EXISTING_VM_ID2 ) ; snapshot = dao.get ( org.ovirt.engine.core.dao.SnapshotDaoTest.EXISTING_SNAPSHOT_ID2 ) ; org.junit.Assert.assertEquals ( StringUtils.EMPTY , snapshot.getMemoryVolume ( ) ) ; }
Source:
public java.lang.Object getConfigValue ( org.ovirt.engine.core.common.queries.ConfigurationValues configValue , java.lang.String version , org.ovirt.engine.ui.frontend.IAsyncConverter converter ) { if ( converter == null ) { return null ; } org.ovirt.engine.core.compat.KeyValuePairCompat < org.ovirt.engine.core.common.queries.ConfigurationValues , java.lang.String > key = new org.ovirt.engine.core.compat.KeyValuePairCompat < org.ovirt.engine.core.common.queries.ConfigurationValues , java.lang.String > ( configValue , version ) ; return converter.Convert ( cachedConfigValuesPreConvert.get ( key ) , null ) ; }

Target:
public void getMaxNumOfThreadsPerCpu ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { 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 ) ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfThreadsPerCpu ) ; tempVar.setVersion ( version ) ; getConfigFromCache ( tempVar , aQuery ) ; }
Source:
protected void executeCommand ( ) { if ( isLiveMerge ( ) ) { org.ovirt.engine.core.bll.RemoveDiskSnapshotsCommand.getParameters ( ) . setLiveMerge ( true ) ; persistCommand ( org.ovirt.engine.core.bll.RemoveDiskSnapshotsCommand.getParameters ( ) . getParentCommand ( ) , true ) ; } org.ovirt.engine.core.bll.RemoveDiskSnapshotsCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { if ( isLiveMerge ( ) ) { org.ovirt.engine.core.bll.RemoveDiskSnapshotsCommand.getParameters ( ) . setLiveMerge ( true ) ; persistCommand ( org.ovirt.engine.core.bll.RemoveDiskSnapshotsCommand.getParameters ( ) . getParentCommand ( ) , true ) ; } removeCinderSnapshotDisks ( ) ; org.ovirt.engine.core.bll.RemoveDiskSnapshotsCommand.setSucceeded ( true ) ; }
Source:
public boolean shouldVdsBeFenced ( ) { boolean result = false ; if ( ( vds ) == null ) { return false ; } switch ( vds.getStatus ( ) ) { case Down : case InstallFailed : case Maintenance : case NonOperational : case NonResponsive : result = true ; break ; default : break ; } return result ; }

Target:
public boolean shouldVdsBeFenced ( ) { boolean result = false ; if ( ( vds ) == null ) { return false ; } switch ( vds.getStatus ( ) ) { case Down : case InstallFailed : case Maintenance : case NonOperational : case NonResponsive : case Kdumping : result = true ; break ; default : break ; } return result ; }
Source:
public static java.lang.String rangeParsser ( java.util.ArrayList a ) { return java.lang.String.valueOf ( ( ( org.ovirt.vdsmfake.Utils.RND.nextInt ( ( ( java.lang.Integer.valueOf ( a.get ( 1 ) . toString ( ) ) ) - ( java.lang.Integer.valueOf ( a.get ( 0 ) . toString ( ) ) ) ) ) ) + ( java.lang.Integer.valueOf ( a.get ( 0 ) . toString ( ) ) ) ) ) ; }

Target:
public static java.lang.String rangeParsser ( java.util.List < java.lang.String > values ) { return java.lang.String.valueOf ( ( ( org.ovirt.vdsmfake.Utils.RND.nextInt ( ( ( java.lang.Integer.valueOf ( values.get ( 1 ) . toString ( ) ) ) - ( java.lang.Integer.valueOf ( values.get ( 0 ) . toString ( ) ) ) ) ) ) + ( java.lang.Integer.valueOf ( values.get ( 0 ) . toString ( ) ) ) ) ) ; }
Source:
public void canDoActionMissingTemplateDisk ( ) { createParameters ( ) ; org.ovirt.engine.core.common.businessentities.DiskImage diskImage = initDiskImage ( diskImageGroupId , diskImageId ) ; org.ovirt.engine.core.compat.Guid templateImageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; diskImage.setImageTemplateId ( templateImageId ) ; initDiskImage ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , templateImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_NOT_FOUND_ON_DESTINATION_DOMAIN.toString ( ) ) ) ; }

Target:
public void canDoActionMissingTemplateDisk ( ) { createParameters ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = initDiskImage ( diskImageGroupId , diskImageId ) ; org.ovirt.engine.core.compat.Guid templateImageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; diskImage.setImageTemplateId ( templateImageId ) ; initDiskImage ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , templateImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_NOT_FOUND_ON_DESTINATION_DOMAIN.toString ( ) ) ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity getByName ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String glusterCommand , org.ovirt.engine.core.common.businessentities.gluster.GlusterHookStage stage , java.lang.String hookName ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity glusterHook = getCallsHandler ( ) . executeRead ( "GetGlusterHookByName" , org.ovirt.engine.core.dao.gluster.GlusterHooksDaoDbFacadeImpl.glusterHookRowMapper , getCustomMapSqlParameterSource ( ) . addValue ( "cluster_id" , clusterId ) . addValue ( "gluster_command" , glusterCommand ) . addValue ( "stage" , org.ovirt.engine.core.common.utils.EnumUtils.nameOrNull ( stage ) ) . addValue ( "name" , hookName ) ) ; if ( glusterHook != null ) { getGlusterServerHook ( glusterHook , null ) ; } return glusterHook ; }

Target:
public org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity getById ( org.ovirt.engine.core.compat.Guid id , boolean eagerLoad ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity glusterHook = getCallsHandler ( ) . executeRead ( "GetGlusterHookById" , org.ovirt.engine.core.dao.gluster.GlusterHooksDaoDbFacadeImpl.glusterHookRowMapper , createIdParameterMapper ( id ) . addValue ( "includeContent" , eagerLoad ) ) ; if ( eagerLoad ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook > serverHooks = getCallsHandler ( ) . executeReadList ( "GetGlusterServerHooksById" , org.ovirt.engine.core.dao.gluster.GlusterHooksDaoDbFacadeImpl.glusterServerHookRowMapper , createIdParameterMapper ( id ) ) ; if ( serverHooks != null ) { glusterHook.setServerHooks ( serverHooks ) ; } } return glusterHook ; }
Source:
private boolean ContainsLocalStorage ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel model ) { for ( org.ovirt.engine.core.common.businessentities.StorageDomain a : org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.StorageDomain > Cast ( getSelectedItems ( ) ) ) { if ( ( a.getstorage_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) { return true ; } } return false ; }

Target:
private boolean ContainsLocalStorage ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel model ) { for ( org.ovirt.engine.core.common.businessentities.StorageDomain a : org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.StorageDomain > Cast ( getSelectedItems ( ) ) ) { if ( ( a.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) { return true ; } } return false ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc stopImageTransferSession ( java.lang.String ticketId , java.lang.String spId , java.lang.String sdId , java.lang.String imgId , java.lang.String volId ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.stopImageTransferSession" ) . withParameter ( "ticketUUID" , ticketId ) . withParameter ( "spUUID" , spId ) . withParameter ( "sdUUID" , sdId ) . withParameter ( "imgUUID" , imgId ) . withParameter ( "volUUID" , volId ) . 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.irsbroker.StatusReturnForXmlRpc teardownImage ( java.lang.String spID , java.lang.String sdID , java.lang.String imageID , java.lang.String volumeID ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Image.teardown" ) . withParameter ( "storagepoolID" , spID ) . withParameter ( "storagedomainID" , sdID ) . withParameter ( "imageID" , imageID ) . withParameter ( "leafVolID" , volumeID ) . 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.irsbroker.StatusReturnForXmlRpc ( response ) ; }
Source:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.DisableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( CLUSTER_ID , HOOK_ID ) ) ) ; setupMocks ( cmd ) ; mockBackendStatusChange ( cmd , true ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getSucceeded ( ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_DISABLE ) ; }

Target:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.DisableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookStatusChangeParameters ( CLUSTER_ID , HOOK_ID ) ) ) ; setupMocks ( cmd ) ; mockBackendStatusChange ( cmd , true ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getSucceeded ( ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_DISABLE ) ; }
Source:
public void EnsureAsyncSearchStopped ( ) { getTimer ( ) . stop ( ) ; if ( ( ( getAsyncResult ( ) ) != null ) && ( ! ( getAsyncResult ( ) . getId ( ) . equals ( NGuid.Empty ) ) ) ) { setAsyncResult ( null ) ; } }

Target:
public void ensureAsyncSearchStopped ( ) { getTimer ( ) . stop ( ) ; if ( ( ( getAsyncResult ( ) ) != null ) && ( ! ( getAsyncResult ( ) . getId ( ) . equals ( NGuid.Empty ) ) ) ) { setAsyncResult ( null ) ; } }
Source:
public org.ovirt.engine.core.bll.ValidationResult bootProtocolSetForDisplayNetwork ( ) { org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = attachment.getIpConfiguration ( ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.ACTION_TYPE_FAILED_DISPLAY_NETWORK_HAS_NO_BOOT_PROTOCOL ) . unless ( ( ( ! ( getNetworkCluster ( ) . isDisplay ( ) ) ) || ( ( ipConfiguration != null ) && ( ( ipConfiguration.getBootProtocol ( ) ) != ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.NONE ) ) ) ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult bootProtocolSetForDisplayNetwork ( ) { org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = attachment.getIpConfiguration ( ) ; boolean failWhen = ( getNetworkCluster ( ) . isDisplay ( ) ) && ( ( ipConfiguration == null ) || ( ( ipConfiguration.getBootProtocol ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.NONE ) ) ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.ACTION_TYPE_FAILED_DISPLAY_NETWORK_HAS_NO_BOOT_PROTOCOL ) . when ( failWhen ) ; }
Source:
public void canRunVmFailNodisk ( ) { initDAOMocks ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.Disk > emptyList ( ) ) ; final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.VdsSelector ( vm , new org.ovirt.engine.core.compat.Guid ( ) , true , new org.ovirt.engine.core.bll.VdsFreeMemoryChecker ( command ) ) ) . when ( command ) . getVdsSelector ( ) ; org.junit.Assert.assertFalse ( command.canRunVm ( vm ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( "VM_CANNOT_RUN_FROM_DISK_WITHOUT_DISK" ) ) ; }

Target:
private void mockIsoDomainListSyncronizer ( ) { org.mockito.Mockito.doNothing ( ) . when ( isoDomainListSyncronizer ) . init ( ) ; org.mockito.Mockito.doReturn ( isoDomainListSyncronizer ) . when ( command ) . getIsoDomainListSyncronizer ( ) ; }