auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void endSuccessfully ( ) { org.ovirt.engine.core.common.action.VdcReturnValueBase ret = org.ovirt.engine.core.bll.UpdateVmDiskCommand.getBackend ( ) . endAction ( VdcActionType.ExtendImageSize , createExtendImageSizeParameters ( ) ) ; if ( ret.getSucceeded ( ) ) { performDiskUpdate ( true ) ; } else { unlockImageInDb ( ) ; } org.ovirt.engine.core.bll.UpdateVmDiskCommand.getReturnValue ( ) . setEndActionTryAgain ( false ) ; setSucceeded ( ret.getSucceeded ( ) ) ; }

Target:
private void endInternalCommandWithFailure ( ) { org.ovirt.engine.core.common.action.ExtendImageSizeParameters params = createExtendImageSizeParameters ( ) ; params.setTaskGroupSuccess ( false ) ; org.ovirt.engine.core.bll.UpdateVmDiskCommand.getBackend ( ) . endAction ( VdcActionType.ExtendImageSize , params , org.ovirt.engine.core.bll.UpdateVmDiskCommand.getContext ( ) . clone ( ) . withoutCompensationContext ( ) . withoutExecutionContext ( ) . withoutLock ( ) ) ; }
Source:
protected java.util.Map < java.lang.String , java.lang.Object > createParametersStruct ( ) { java.util.Map < java.lang.String , java.lang.Object > struct = new java.util.HashMap < > ( ) ; struct.put ( VdsProperties.vm_guid , org.ovirt.engine.core.vdsbroker.vdsbroker.HotPlugOrUnplugNicVDSCommand.getParameters ( ) . getVm ( ) . getId ( ) . toString ( ) ) ; struct.put ( VdsProperties.VM_NETWORK_INTERFACE , initNicStructure ( ) ) ; return struct ; }

Target:
protected java.util.Map < java.lang.String , java.lang.Object > createParametersStruct ( ) { java.util.Map < java.lang.String , java.lang.Object > struct = new java.util.HashMap < > ( ) ; struct.put ( VdsProperties.vm_guid , org.ovirt.engine.core.vdsbroker.vdsbroker.HotPlugOrUnplugNicVDSCommand.getParameters ( ) . getVm ( ) . getId ( ) . toString ( ) ) ; struct.put ( VdsProperties.VM_NETWORK_INTERFACE , initNicStructure ( ) ) ; struct.put ( VdsProperties.engineXml , generateDomainXml ( ) ) ; return struct ; }
Source:
protected void executeCommand ( ) { registerRollbackHandler ( ( ( org.ovirt.engine.core.utils.transaction.TransactionRollbackListener ) ( ( ) -> org.ovirt.engine.core.bll.macPoolPerCluster.modifyPool ( oldMacPool ) ) ) ) ; macPoolDao.update ( getMacPoolEntity ( ) ) ; macPoolPerCluster.modifyPool ( getMacPoolEntity ( ) ) ; setSucceeded ( true ) ; getReturnValue ( ) . setActionReturnValue ( getMacPoolId ( ) ) ; }

Target:
protected void executeCommand ( ) { registerRollbackHandler ( ( ( org.ovirt.engine.core.utils.transaction.TransactionRollbackListener ) ( ( ) -> org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( ( ( TransactionMethod < java.lang.Void > ) ( ( ) -> { org.ovirt.engine.core.bll.macPoolPerCluster.removePool ( oldMacPool.getId ( ) ) ; org.ovirt.engine.core.bll.macPoolPerCluster.createPool ( oldMacPool ) ; return null ; } ) ) ) ) ) ) ; macPoolDao.update ( getMacPoolEntity ( ) ) ; macPoolPerCluster.modifyPool ( getMacPoolEntity ( ) ) ; setSucceeded ( true ) ; getReturnValue ( ) . setActionReturnValue ( getMacPoolId ( ) ) ; }
Source:
public void validateVmMemoryCanStartOnVdsVmTooBigButLowOverhead ( ) { vm.setMinAllocatedMem ( 8865 ) ; vm.setVmMemSizeMb ( 8865 ) ; vds.setGuestOverhead ( 0 ) ; boolean vmPassedMemoryRequirement = org.ovirt.engine.core.bll.scheduling.SlaValidator.getInstance ( ) . hasPhysMemoryToRunVM ( vds , vm , 0 ) ; org.junit.Assert.assertEquals ( vmPassedMemoryRequirement , true ) ; }

Target:
public void validateVmMemoryCanStartOnVdsVmTooBigButLowOverhead ( ) { vm.setMinAllocatedMem ( 8865 ) ; vm.setVmMemSizeMb ( 8865 ) ; org.mockito.Mockito.doReturn ( 0 ) . when ( vmOverheadCalculator ) . getStaticOverheadInMb ( org.mockito.Matchers.any ( ) ) ; boolean vmPassedMemoryRequirement = slaValidator.hasPhysMemoryToRunVM ( vds , vm , 0 ) ; org.junit.Assert.assertTrue ( vmPassedMemoryRequirement ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VDSGroup mockVdsGroup ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup group = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; group.setvds_group_id ( vdsGroupId ) ; group.setcompatibility_version ( new org.ovirt.engine.core.compat.Version ( ) ) ; group.setStoragePoolId ( storagePoolId ) ; return group ; }

Target:
private org.ovirt.engine.core.common.businessentities.VDSGroup mockVdsGroup ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup group = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; group.setvds_group_id ( vdsGroupId ) ; group.setcompatibility_version ( new org.ovirt.engine.core.compat.Version ( ) ) ; group.setStoragePoolId ( storagePoolId ) ; group.setcpu_name ( "Intel Conroe Family" ) ; group.setArchitecture ( ArchitectureType.x86_64 ) ; return group ; }
Source:
public void render ( org.ovirt.engine.ui.common.widget.table.column.Context context , java.lang.String value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { if ( value != null ) { com.google.gwt.safehtml.shared.SafeHtml escapedValue = getEscapedValue ( value ) ; com.google.gwt.safehtml.shared.SafeHtml renderedValue = getRenderedValue ( escapedValue ) ; sb.append ( org.ovirt.engine.ui.common.widget.table.column.TextCellWithTooltip.template.textContainer ( org.ovirt.engine.ui.common.utils.ElementIdUtils.createTableCellElementId ( elementIdPrefix , columnId , context ) , renderedValue ) ) ; } }

Target:
public void render ( org.ovirt.engine.ui.common.widget.table.column.Context context , java.lang.String value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { if ( value != null ) { com.google.gwt.safehtml.shared.SafeHtml escapedValue = getEscapedValue ( value ) ; com.google.gwt.safehtml.shared.SafeHtml renderedValue = getRenderedValue ( escapedValue ) ; sb.append ( org.ovirt.engine.ui.common.widget.table.column.TextCellWithTooltip.template.textContainer ( styleClass , org.ovirt.engine.ui.common.utils.ElementIdUtils.createTableCellElementId ( elementIdPrefix , columnId , context ) , renderedValue ) ) ; } }
Source:
public void Execute ( java.lang.Object ... parameters ) { if ( ( ! ( getIsAvailable ( ) ) ) || ( ! ( getIsExecutionAllowed ( ) ) ) ) { return ; } if ( ( target ) != null ) { if ( ( parameters == null ) || ( ( parameters.length ) == 0 ) ) { target.ExecuteCommand ( this ) ; } else { target.ExecuteCommand ( this , parameters ) ; } } }

Target:
public void Execute ( java.lang.Object ... parameters ) { if ( ( ! ( getIsAvailable ( ) ) ) || ( ! ( getIsExecutionAllowed ( ) ) ) ) { return ; } if ( ( target ) != null ) { if ( ( parameters == null ) || ( ( parameters.length ) == 0 ) ) { target.executeCommand ( this ) ; } else { target.executeCommand ( this , parameters ) ; } } }
Source:
protected boolean canDoAction ( ) { if ( ( org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.isImagesAlreadyOnTarget ( ) ) && ( ! ( validateImagesOnStorage ( vmFromConfiguration , ovfEntityData ) ) ) ) { return false ; } return super . canDoAction ( ) ; }

Target:
protected boolean canDoAction ( ) { if ( ( org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.isImagesAlreadyOnTarget ( ) ) && ( ! ( validateUnregisteredEntity ( vmFromConfiguration , ovfEntityData ) ) ) ) { return false ; } setImagesWithStoragePoolId ( org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getStorageDomain ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getVm ( ) . getImages ( ) ) ; return super . canDoAction ( ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { getModel ( ) . getIsSoundcardEnabled ( ) . setEntity ( returnValue ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.List < org.ovirt.engine.core.common.businessentities.VmRngDevice > devs = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; getModel ( ) . getIsRngEnabled ( ) . setEntity ( ( ! ( devs.isEmpty ( ) ) ) ) ; getModel ( ) . setRngDevice ( ( devs.isEmpty ( ) ? new org.ovirt.engine.core.common.businessentities.VmRngDevice ( ) : devs.get ( 0 ) ) ) ; }
Source:
protected void loadPolicyUnits ( ) { java.util.List < org.ovirt.engine.core.common.scheduling.PolicyUnit > allPolicyUnits = getPolicyUnitDao ( ) . getAll ( ) ; for ( org.ovirt.engine.core.common.scheduling.PolicyUnit policyUnit : allPolicyUnits ) { if ( policyUnit.isInternal ( ) ) { policyUnits.put ( policyUnit.getId ( ) , org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl.getPolicyUnitImpl ( policyUnit ) ) ; } else { policyUnits.put ( policyUnit.getId ( ) , new org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl ( policyUnit ) ) ; } } }

Target:
protected void loadPolicyUnits ( ) { java.util.List < org.ovirt.engine.core.common.scheduling.PolicyUnit > allPolicyUnits = getPolicyUnitDao ( ) . getAll ( ) ; for ( org.ovirt.engine.core.common.scheduling.PolicyUnit policyUnit : allPolicyUnits ) { if ( policyUnit.isInternal ( ) ) { policyUnits.put ( policyUnit.getId ( ) , org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl.getPolicyUnitImpl ( policyUnit , getPendingResourceManager ( ) ) ) ; } else { policyUnits.put ( policyUnit.getId ( ) , new org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl ( policyUnit , getPendingResourceManager ( ) ) ) ; } } }
Source:
private java.lang.String getPublicCollection ( java.lang.String collectionName , boolean throwError ) { try { return getPublicCollection ( collectionName ) ; } catch ( java.lang.RuntimeException rte ) { if ( ! throwError ) return null ; throw rte ; } }

Target:
private java.lang.String getPublicEntity ( java.lang.String entityName , java.lang.String [ ] periods , int i , boolean throwError ) { try { return getPublicEntity ( entityName , periods , i ) ; } catch ( java.lang.RuntimeException rte ) { if ( ! throwError ) return null ; throw rte ; } }
Source:
protected void endExecutionMonitoring ( ) { if ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . isRunAndPause ( ) ) && ( ( vmDynamicDao.get ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) ) { final org.ovirt.engine.core.bll.job.ExecutionContext executionContext = org.ovirt.engine.core.bll.RunVmCommand.getExecutionContext ( ) ; executionContext.setShouldEndJob ( true ) ; executionHandler.endJob ( executionContext , true ) ; } else { super . endExecutionMonitoring ( ) ; } }

Target:
public void onPowerringUp ( ) { decreasePendingVm ( vmStaticDao.get ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) ) ) ; }
Source:
private void verifyAsyncActionStartedAndCompleted ( ) { verifyAsyncActionStarted ( ) ; org.mockito.Mockito.verify ( mockEventBus , org.mockito.Mockito.atLeastOnce ( ) ) . fireEvent ( new org.ovirt.engine.ui.frontend.communication.AsyncOperationCompleteEvent ( testState ) ) ; }

Target:
public void tearDown ( ) throws java.lang.Exception { org.mockito.Mockito.verify ( mockEventBus , org.mockito.Mockito.never ( ) ) . fireEvent ( new org.ovirt.engine.ui.frontend.communication.AsyncOperationCompleteEvent ( testState , false , true ) ) ; org.mockito.Mockito.verify ( mockEventBus , org.mockito.Mockito.never ( ) ) . fireEvent ( new org.ovirt.engine.ui.frontend.communication.AsyncOperationCompleteEvent ( testState , false , false ) ) ; }
Source:
public void testGetNotFound ( ) { org.ovirt.engine.api.restapi.resource.BackendVmApplicationResource resource = getNotFoundResource ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( ) ; try { resource.get ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) { org.ovirt.engine.api.restapi.resource.BackendVmApplicationResource resource = getNotFoundResource ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( ) ; verifyNotFoundException ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , resource :: get ) ) ; }
Source:
private void assertRangeAltering ( int numberOfRanges , java.util.List < java.lang.Integer > rangesWithoutAvailableMacs , java.util.List < java.lang.Integer > expectedRangeIndices ) { java.util.List < org.ovirt.engine.core.bll.network.macpoolmanager.Range > ranges = createMockedRanges ( numberOfRanges ) ; mockAvailableMacsInRange ( ranges , rangesWithoutAvailableMacs ) ; org.ovirt.engine.core.bll.network.macpoolmanager.MacsStorage macsStorage = new org.ovirt.engine.core.bll.network.macpoolmanager.MacsStorage ( false ) ; addRangesToStorage ( ranges , macsStorage ) ; assertReturnedRange ( ranges , macsStorage , expectedRangeIndices ) ; }

Target:
private void assertRangeAltering ( int numberOfRanges , java.util.List < java.lang.Integer > rangesWithoutAvailableMacs , java.util.List < java.lang.Integer > expectedRangeIndices ) { java.util.List < org.ovirt.engine.core.bll.network.macpool.Range > ranges = createMockedRanges ( numberOfRanges ) ; mockAvailableMacsInRange ( ranges , rangesWithoutAvailableMacs ) ; org.ovirt.engine.core.bll.network.macpool.MacsStorage macsStorage = new org.ovirt.engine.core.bll.network.macpool.MacsStorage ( false ) ; addRangesToStorage ( ranges , macsStorage ) ; assertReturnedRange ( ranges , macsStorage , expectedRangeIndices ) ; }
Source:
static org.ovirt.engine.api.model.Cluster getModel ( int index ) { org.ovirt.engine.api.model.Cluster model = new org.ovirt.engine.api.model.Cluster ( ) ; model.setName ( NAMES [ index ] ) ; model.setDescription ( DESCRIPTIONS [ index ] ) ; model.setDataCenter ( new org.ovirt.engine.api.model.DataCenter ( ) ) ; model.setCpu ( new org.ovirt.engine.api.model.CPU ( ) ) ; model.getCpu ( ) . setId ( "Intel Xeon" ) ; return model ; }

Target:
static org.ovirt.engine.api.model.Cluster getModel ( int index ) { org.ovirt.engine.api.model.Cluster model = new org.ovirt.engine.api.model.Cluster ( ) ; model.setName ( NAMES [ index ] ) ; model.setDescription ( DESCRIPTIONS [ index ] ) ; model.setDataCenter ( new org.ovirt.engine.api.model.DataCenter ( ) ) ; model.setCpu ( new org.ovirt.engine.api.model.Cpu ( ) ) ; model.getCpu ( ) . setType ( "Intel Xeon" ) ; return model ; }
Source:
public static void isSoundcardEnabled ( 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 ( ( ( java.util.List < java.lang.String > ) ( source ) ) . size ( ) ) > 0 ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetSoundDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
private static void initMemorySnapshotSupportMap ( ) { 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.memorySnapshotSupport = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetArchitectureCapabilities , new org.ovirt.engine.core.common.queries.ArchCapabilitiesParameters ( org.ovirt.engine.core.common.queries.ArchCapabilitiesParameters.ArchCapabilitiesVerb.GetMemorySnapshotSupport ) , callback ) ; }
Source:
private org.ovirt.engine.core.common.action.VdcActionType addActionTypeForQosType ( org.ovirt.engine.api.model.QosType qosType ) { switch ( qosType ) { case STORAGE : return org.ovirt.engine.core.common.action.VdcActionType.AddStorageQos ; case CPU : return org.ovirt.engine.core.common.action.VdcActionType.AddCpuQos ; case NETWORK : return org.ovirt.engine.core.common.action.VdcActionType.AddNetworkQoS ; case HOSTNETWORK : return org.ovirt.engine.core.common.action.VdcActionType.AddHostNetworkQos ; default : throw new java.lang.IllegalArgumentException ( ( ( "Unsupported QoS type \"" + qosType ) + "\"" ) ) ; } }

Target:
private org.ovirt.engine.core.common.action.ActionType addActionTypeForQosType ( org.ovirt.engine.api.model.QosType qosType ) { switch ( qosType ) { case STORAGE : return org.ovirt.engine.core.common.action.ActionType.AddStorageQos ; case CPU : return org.ovirt.engine.core.common.action.ActionType.AddCpuQos ; case NETWORK : return org.ovirt.engine.core.common.action.ActionType.AddNetworkQoS ; case HOSTNETWORK : return org.ovirt.engine.core.common.action.ActionType.AddHostNetworkQos ; default : throw new java.lang.IllegalArgumentException ( ( ( "Unsupported QoS type \"" + qosType ) + "\"" ) ) ; } }
Source:
public void testAllLunsHaveDiscardZeroesTheDataSupportSucceeds ( ) { org.junit.Assert.assertTrue ( discardHelper.allLunsHaveDiscardZeroesTheDataSupport ( java.util.Arrays.asList ( createLunWithDiscardFunctionality ( 1024L , true ) , createLunWithDiscardFunctionality ( 0L , true ) ) ) ) ; }

Target:
public void testExistingPassDiscardFunctionalityIsPreservedAllLunsHaveDiscardFunctionality ( ) { storageDomain.setSupportsDiscard ( true ) ; storageDomainDisks.add ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; org.junit.Assert.assertTrue ( discardHelper.isExistingPassDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardSupport ( 1024L ) , createLunWithDiscardSupport ( 2048L ) ) , storageDomain ) ) ; }
Source:
protected boolean evaluateReturnValue ( org.ovirt.engine.core.common.AuditLogType auditLogType , org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue ) { boolean succeeded = returnValue.getCanDoAction ( ) ; if ( ! succeeded ) { handleVdsErrors ( auditLogType , returnValue.getCanDoActionMessages ( ) ) ; } succeeded = succeeded && ( returnValue.getSucceeded ( ) ) ; if ( ! succeeded ) { handleVdsErrors ( auditLogType , returnValue.getExecuteFailedMessages ( ) ) ; } return succeeded ; }

Target:
protected boolean evaluateReturnValue ( org.ovirt.engine.core.common.AuditLogType auditLogType , org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue ) { boolean succeeded = returnValue.isValid ( ) ; if ( ! succeeded ) { handleVdsErrors ( auditLogType , returnValue.getValidationMessages ( ) ) ; } succeeded = succeeded && ( returnValue.getSucceeded ( ) ) ; if ( ! succeeded ) { handleVdsErrors ( auditLogType , returnValue.getExecuteFailedMessages ( ) ) ; } return succeeded ; }
Source:
private void setUpGetVirtioScsiExpectations ( int ... idxs ) throws java.lang.Exception { for ( int i = 0 ; i < ( idxs.length ) ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVirtioScsiControllers , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ idxs [ i ] ] } , new java.util.ArrayList < > ( ) ) ; } }

Target:
protected void setUpGetPayloadExpectations ( int times , int index ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmPayload payload = new org.ovirt.engine.core.common.businessentities.VmPayload ( ) ; for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVmPayload , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , payload ) ; } }
Source:
public static org.ovirt.engine.api.model.StorageDomainStatus map ( org.ovirt.engine.api.model.StorageDomainStatus status , org.ovirt.engine.api.model.StorageDomainStatus template ) { switch ( status ) { case Unattached : return org.ovirt.engine.api.model.StorageDomainStatus.UNATTACHED ; case Active : return org.ovirt.engine.api.model.StorageDomainStatus.ACTIVE ; case Inactive : return org.ovirt.engine.api.model.StorageDomainStatus.INACTIVE ; case Locked : return org.ovirt.engine.api.model.StorageDomainStatus.LOCKED ; case PreparingForMaintenance : return org.ovirt.engine.api.model.StorageDomainStatus.PREPARING_FOR_MAINTENANCE ; case Detaching : return org.ovirt.engine.api.model.StorageDomainStatus.DETACHING ; case Maintenance : return org.ovirt.engine.api.model.StorageDomainStatus.MAINTENANCE ; case Unknown : return org.ovirt.engine.api.model.StorageDomainStatus.UNKNOWN ; case Uninitialized : return null ; default : return null ; } }

Target:
public static org.ovirt.engine.api.model.StorageDomainStatus map ( org.ovirt.engine.api.model.StorageDomainStatus status , org.ovirt.engine.api.model.StorageDomainStatus template ) { switch ( status ) { case Unattached : return org.ovirt.engine.api.model.StorageDomainStatus.UNATTACHED ; case Activating : return org.ovirt.engine.api.model.StorageDomainStatus.ACTIVATING ; case Active : return org.ovirt.engine.api.model.StorageDomainStatus.ACTIVE ; case Inactive : return org.ovirt.engine.api.model.StorageDomainStatus.INACTIVE ; case Locked : return org.ovirt.engine.api.model.StorageDomainStatus.LOCKED ; case PreparingForMaintenance : return org.ovirt.engine.api.model.StorageDomainStatus.PREPARING_FOR_MAINTENANCE ; case Detaching : return org.ovirt.engine.api.model.StorageDomainStatus.DETACHING ; case Maintenance : return org.ovirt.engine.api.model.StorageDomainStatus.MAINTENANCE ; case Unknown : return org.ovirt.engine.api.model.StorageDomainStatus.UNKNOWN ; case Uninitialized : return null ; default : return null ; } }
Source:
protected void onEntityChanged ( ) { super . onEntityChanged ( ) ; if ( ( getEntity ( ) ) != null ) { updateAlerts ( ) ; updateMemory ( ) ; updateSwapUsed ( ) ; updateProperties ( ) ; } }

Target:
public void saveNICsConfig ( ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.CommitNetworkChanges , new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.action.VdcActionParametersBase [ ] { new org.ovirt.engine.core.common.action.VdsActionParameters ( getEntity ( ) . getId ( ) ) } ) ) , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , null ) ; }
Source:
public static void GetAllProvidersByType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ProviderType providerType ) { 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.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( providerType ) , aQuery ) ; }

Target:
public static void getAllProvidersByType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ProviderType providerType ) { 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.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( providerType ) , aQuery ) ; }
Source:
private void override_EntityChanged ( org.ovirt.engine.ui.uicompat.EventArgs e ) { boolean isChangeable = ( ( java.lang.Boolean ) ( getOverride ( ) . getEntity ( ) ) ) ; getVersion ( ) . setIsChangable ( isChangeable ) ; getRetransmissions ( ) . setIsChangable ( isChangeable ) ; getTimeout ( ) . setIsChangable ( isChangeable ) ; getMountOptions ( ) . setIsChangable ( isChangeable ) ; getMountOptions ( ) . setTitle ( ( isChangeable ? org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . mountOptionsHint ( ) : null ) ) ; }

Target:
private void override_EntityChanged ( org.ovirt.engine.ui.uicompat.EventArgs e ) { boolean isChangeable = ( ( java.lang.Boolean ) ( getOverride ( ) . getEntity ( ) ) ) ; getVersion ( ) . setIsChangeable ( isChangeable ) ; getRetransmissions ( ) . setIsChangeable ( isChangeable ) ; getTimeout ( ) . setIsChangeable ( isChangeable ) ; getMountOptions ( ) . setIsChangeable ( isChangeable ) ; getMountOptions ( ) . setTitle ( ( isChangeable ? org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . mountOptionsHint ( ) : null ) ) ; }
Source:
public void getUsbPolicyOnUpdateCurrentlyDisabledGotEnabledPolicyNotSetUsbOnPre3_1Cluster ( ) { org.ovirt.engine.api.model.Usb usb = new org.ovirt.engine.api.model.Usb ( ) ; usb.setEnabled ( true ) ; org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; vdsGroup.setcompatibility_version ( Version.v3_0 ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnUpdate ( usb , UsbPolicy.DISABLED , vdsGroup ) , UsbPolicy.ENABLED_LEGACY ) ; }

Target:
public void getUsbPolicyOnUpdateCurrentlyDisabledGotEnabledPolicyNotSetUsbOnPre3_1Cluster ( ) { org.ovirt.engine.api.model.Usb usb = new org.ovirt.engine.api.model.Usb ( ) ; usb.setEnabled ( true ) ; org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; vdsGroup.setcompatibility_version ( Version.v3_0 ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnUpdate ( usb , UsbPolicy.DISABLED , vdsGroup.getcompatibility_version ( ) ) , UsbPolicy.ENABLED_LEGACY ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.PermissionSubject > getPermissionCheckSubjects ( ) { if ( ( permsList ) == null ) { permsList = super . getPermissionCheckSubjects ( ) ; org.ovirt.engine.core.compat.Guid diskId = ( ( disk ) == null ) ? null : disk.getId ( ) ; permsList.add ( new org.ovirt.engine.core.common.PermissionSubject ( diskId , org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.core.common.businessentities.ActionGroup.ATTACH_DISK ) ) ; } return permsList ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { if ( ( permsList ) == null ) { permsList = super . getPermissionCheckSubjects ( ) ; org.ovirt.engine.core.compat.Guid diskId = ( ( disk ) == null ) ? null : disk.getId ( ) ; permsList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( diskId , org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.core.common.businessentities.ActionGroup.ATTACH_DISK ) ) ; } return permsList ; }
Source:
private void UpdateActionAvailability ( ) { java.util.List < org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface , org.ovirt.engine.core.common.businessentities.VDS > > selectedItems = ( ( getSelectedItems ( ) ) != null ) ? getSelectedItems ( ) : new java.util.ArrayList ( ) ; getSetupNetworksCommand ( ) . setIsExecutionAllowed ( ( ( ( selectedItems.size ( ) ) == 1 ) && ( ( selectedItems.get ( 0 ) . getSecond ( ) . getvds_group_compatibility_version ( ) . compareTo ( Version.v3_1 ) ) >= 0 ) ) ) ; }

Target:
private void updateActionAvailability ( ) { java.util.List < org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface , org.ovirt.engine.core.common.businessentities.VDS > > selectedItems = ( ( getSelectedItems ( ) ) != null ) ? getSelectedItems ( ) : new java.util.ArrayList ( ) ; getSetupNetworksCommand ( ) . setIsExecutionAllowed ( ( ( ( selectedItems.size ( ) ) == 1 ) && ( ( selectedItems.get ( 0 ) . getSecond ( ) . getvds_group_compatibility_version ( ) . compareTo ( Version.v3_1 ) ) >= 0 ) ) ) ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmNicFilterParameter , org.ovirt.engine.core.common.action.RemoveVmNicFilterParameterParameters.class , new java.lang.String [ ] { "VmId" , "FilterParameterId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicFilterParameterResourceTest.VM_ID , org.ovirt.engine.api.restapi.resource.BackendVmNicFilterParameterResourceTest.PARAMETER_ID } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( ActionType.RemoveVmNicFilterParameter , org.ovirt.engine.core.common.action.RemoveVmNicFilterParameterParameters.class , new java.lang.String [ ] { "VmId" , "FilterParameterId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicFilterParameterResourceTest.VM_ID , org.ovirt.engine.api.restapi.resource.BackendVmNicFilterParameterResourceTest.PARAMETER_ID } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
private void verifyStorageDomain ( org.ovirt.engine.api.model.StorageDomain model ) { org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.STORAGE_DOMAIN_ID.toString ( ) , model.getId ( ) ) ; org.junit.Assert.assertNotNull ( model.getDataCenter ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.DATA_CENTER_ID.toString ( ) , model.getDataCenter ( ) . getId ( ) ) ; }

Target:
private void verifyStorageDomain ( org.ovirt.engine.api.model.StorageDomain model ) { org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.STORAGE_DOMAIN_ID.toString ( ) , model.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( model.getDataCenter ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.DATA_CENTER_ID.toString ( ) , model.getDataCenter ( ) . getId ( ) ) ; }
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.getInstance ( ) . runPublicQuery ( VdcQueryType.GetDomainList , tempVar , aQuery ) ; }

Target:
public static void getStorageConnectionsByDataCenterIdAndStorageType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { 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.GetConnectionsByDataCenterAndStorageTypeParameters params = new org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters ( storagePoolId , storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetConnectionsByDataCenterAndStorageType , params , aQuery ) ; }
Source:
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.RunQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.MultilevelAdministrationByAdElementIdParameters ( userId ) , aQuery ) ; }

Target:
public static void GetDataCentersWithPermittedActionOnClusters ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters getEntitiesWithPermittedActionParameters = new org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters ( ) ; getEntitiesWithPermittedActionParameters.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetDataCentersWithPermittedActionOnClusters , getEntitiesWithPermittedActionParameters , aQuery ) ; }
Source:
public com.google.gwt.user.client.ui.Widget resolveValueWidget ( ) { boolean showDefaultValue = ( ( defaultValueCondition ) != null ) && ( defaultValueCondition.showDefaultValue ( ) ) ; com.google.gwt.user.client.ui.Widget resolvedValueWidget = ( showDefaultValue ) ? defaultValueLabel : valueWidget ; boolean showEmptyValue = ( resolvedValueWidget instanceof com.google.gwt.user.client.ui.HasText ) && ( org.ovirt.engine.ui.uicompat.external.StringUtils.isEmpty ( ( ( com.google.gwt.user.client.ui.HasText ) ( resolvedValueWidget ) ) . getText ( ) ) ) ; return showEmptyValue ? emptyValueLabel : resolvedValueWidget ; }

Target:
public com.google.gwt.user.client.ui.Widget resolveValueWidget ( ) { boolean showDefaultValue = ( ( defaultValueCondition ) != null ) && ( defaultValueCondition.showDefaultValue ( ) ) ; com.google.gwt.user.client.ui.Widget resolvedValueWidget = ( showDefaultValue ) ? defaultValueLabel : valueWidget ; boolean showEmptyValue = ( resolvedValueWidget instanceof com.google.gwt.user.client.ui.HasText ) && ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( ( ( com.google.gwt.user.client.ui.HasText ) ( resolvedValueWidget ) ) . getText ( ) ) ) ; return showEmptyValue ? emptyValueLabel : resolvedValueWidget ; }
Source:
protected void endActionOnAllImageGroups ( ) { for ( org.ovirt.engine.core.common.action.VdcActionParametersBase p : org.ovirt.engine.core.bll.storage.export.MoveOrCopyTemplateCommand.getParameters ( ) . getImagesParameters ( ) ) { org.ovirt.engine.core.bll.storage.export.MoveOrCopyTemplateCommand.getBackend ( ) . endAction ( getImagesActionType ( ) , p , org.ovirt.engine.core.bll.storage.export.MoveOrCopyTemplateCommand.getContext ( ) . clone ( ) . withoutCompensationContext ( ) . withoutExecutionContext ( ) . withoutLock ( ) ) ; } }

Target:
protected void endActionOnAllImageGroups ( ) { for ( org.ovirt.engine.core.common.action.VdcActionParametersBase p : org.ovirt.engine.core.bll.storage.export.MoveOrCopyTemplateCommand.getParameters ( ) . getImagesParameters ( ) ) { org.ovirt.engine.core.bll.storage.export.MoveOrCopyTemplateCommand.getBackend ( ) . endAction ( VdcActionType.CopyImageGroup , p , org.ovirt.engine.core.bll.storage.export.MoveOrCopyTemplateCommand.getContext ( ) . clone ( ) . withoutCompensationContext ( ) . withoutExecutionContext ( ) . withoutLock ( ) ) ; } }
Source:
private void doTestValidateModifiedBondSlaves ( org.ovirt.engine.core.common.businessentities.network.Bond bond , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > existingInterfaces , org.ovirt.engine.core.bll.ValidationResult interfaceExistValidationResult , org.ovirt.engine.core.bll.ValidationResult interfaceIsValidSlaveValidationResult , boolean expectedValidationResult , org.ovirt.engine.core.common.errors.VdcBllMessages expectedViolation ) { doTestValidateModifiedBondSlaves ( bond , new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) , existingInterfaces , interfaceExistValidationResult , interfaceIsValidSlaveValidationResult , expectedValidationResult , expectedViolation ) ; }

Target:
private org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator createHostSetupNetworksValidator ( java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks ) { return createHostSetupNetworksValidator ( networks , new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ) ; }
Source:
private void setUpGetEntityExpectations ( int times ) { for ( int i = 0 ; i < times ; i ++ ) { setUpEntityQueryExpectations ( VdcQueryType.GetVmTemplatesDisks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendDisksResourceTest.PARENT_ID } , getEntityList ( ) ) ; } }

Target:
private void setUpGetEntityExpectations ( int times ) { for ( int i = 0 ; i < times ; i ++ ) { setUpEntityQueryExpectations ( VdcQueryType.GetVmTemplatesDisks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendTemplateDiskResourceTest.TEMPLATE_ID } , getEntityList ( ) ) ; } }
Source:
private void doTestBadAddTag ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.AddTag , org.ovirt.engine.core.common.action.TagsOperationParameters.class , new java.lang.String [ ] { "Tag.tag_name" , "Tag.parent_id" } , new java.lang.Object [ ] { NAMES [ 0 ] , org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.PARENT_GUID } , canDo , success ) ) ; try { collection.add ( org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadAddTag ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.AddTag , org.ovirt.engine.core.common.action.TagsOperationParameters.class , new java.lang.String [ ] { "Tag.TagName" , "Tag.ParentId" } , new java.lang.Object [ ] { NAMES [ 0 ] , org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.PARENT_GUID } , canDo , success ) ) ; try { collection.add ( org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
private void getVmParentIds ( org.ovirt.engine.core.compat.Guid id , java.util.List < org.ovirt.engine.core.compat.NGuid > ids ) { org.hibernate.Query query = getSession ( ) . createQuery ( "from VmStatic where id = :id" ) ; query.setParameter ( "id" , id ) ; org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = ( ( org.ovirt.engine.core.common.businessentities.VmStatic ) ( query.uniqueResult ( ) ) ) ; if ( vmStatic != null ) { addVdsGroupId ( vmStatic.getvds_group_id ( ) , ids ) ; } }

Target:
private void getVmParentIds ( org.ovirt.engine.core.compat.Guid id , java.util.List < org.ovirt.engine.core.compat.NGuid > ids ) { org.hibernate.Query query = getSession ( ) . createQuery ( "from VmStatic where id = :id" ) ; query.setParameter ( "id" , id ) ; org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = ( ( org.ovirt.engine.core.common.businessentities.VmStatic ) ( query.uniqueResult ( ) ) ) ; if ( vmStatic != null ) { addVdsGroupId ( vmStatic.getVdsGroupId ( ) , ids ) ; } }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getNetworkDao ( ) ; cluster = new org.ovirt.engine.core.compat.Guid ( "b399944a-81ab-4ec5-8266-e19ba7c3c9d1" ) ; datacenter = org.ovirt.engine.core.dao.FixturesTool.DATA_CENTER ; new_net = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; new_net.setName ( "newnet1" ) ; new_net.setVdsmName ( "newnet1" ) ; new_net.setDescription ( "New network" ) ; new_net.setDataCenterId ( datacenter ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getNetworkDao ( ) ; cluster = org.ovirt.engine.core.dao.FixturesTool.CLUSTER ; datacenter = org.ovirt.engine.core.dao.FixturesTool.DATA_CENTER ; new_net = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; new_net.setName ( "newnet1" ) ; new_net.setVdsmName ( "newnet1" ) ; new_net.setDescription ( "New network" ) ; new_net.setDataCenterId ( datacenter ) ; }
Source:
public void getClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ) ( 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.Cluster > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClustersByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public void getMaxNumOfCPUsPerSocket ( 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.MaxNumOfCpuPerSocket ) ; tempVar.setVersion ( version ) ; getConfigFromCache ( tempVar , aQuery ) ; }
Source:
public void getClusterFeaturesByVersionAndCategory ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version , org.ovirt.engine.core.common.mode.ApplicationMode category ) { 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.Set < org.ovirt.engine.core.common.businessentities.AdditionalFeature > ) ( source ) ) : new java.util.HashSet < org.ovirt.engine.core.common.businessentities.AdditionalFeature > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClusterFeaturesByVersionAndCategory , new org.ovirt.engine.core.common.queries.GetClusterFeaturesByVersionAndCategoryParameters ( version , category ) , aQuery ) ; }

Target:
public void getCinderVolumeTypesList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > > ( ) { @ java.lang.Override public java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetCinderVolumeTypesByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
public void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name , org.ovirt.engine.core.compat.Guid datacenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.core.common.queries.NameQueryParameters params = new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) ; params.setDatacenterId ( datacenterId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmWithSameNameExist , params , aQuery ) ; }

Target:
public void getPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permission > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permission > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }
Source:
private void setUpGetBallooningExpectations ( int times ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.IsBalloonEnabled , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ i ] } , true ) ; } }

Target:
protected void setUpGetPayloadExpectations ( int times ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmPayload payload = new org.ovirt.engine.core.common.businessentities.VmPayload ( ) ; for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVmPayload , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ i ] } , payload ) ; } }
Source:
public void testAddIncompleteParameters_noName ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Network model = new org.ovirt.engine.api.model.Network ( ) ; model.setId ( GUIDS [ 0 ] . toString ( ) ) ; model.setDescription ( DESCRIPTIONS [ 0 ] ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Network" , "add" , "name" ) ; } }

Target:
public void testAddIncompleteParameters_noName ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Network model = new org.ovirt.engine.api.model.Network ( ) ; model.setDescription ( DESCRIPTIONS [ 0 ] ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Network" , "add" , "id|name" ) ; } }