auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void getRoleActionGroupsByRoleId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid roleId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetRoleActionGroupsByRoleId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( roleId ) , aQuery ) ; }

Target:
public static void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.storage.ImageStatus getRawValue ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { return ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ? ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( object ) ) . getImageStatus ( ) : null ; }

Target:
protected org.ovirt.engine.core.common.businessentities.storage.ImageStatus getRawValue ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { return ( ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ) || ( ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.CINDER ) ) ? ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( object ) ) . getImageStatus ( ) : null ; }
Source:
private static void modifySettings ( org.ovirt.engine.api.extensions.ExtMap settingKeys , javax.sql.DataSource dataSource ) throws java.sql.SQLException { java.util.List < java.lang.String > updates = new java.util.ArrayList < > ( ) ; for ( java.util.Map.Entry < org.ovirt.engine.api.extensions.ExtKey , java.lang.Object > entry : settingKeys.entrySet ( ) ) { updates.add ( org.ovirt.engine.extension.aaa.jdbc.Formatter.format ( org.ovirt.engine.extension.aaa.jdbc.Formatter.replaceSchemaPlaceholder ( "UPDATE @SCHEMA_NAME@.settings SET value = WHERE uuid = {}" ) , org.ovirt.engine.extension.aaa.jdbc.Formatter.escapeString ( entry.getValue ( ) ) , org.ovirt.engine.extension.aaa.jdbc.Formatter.escapeString ( entry.getKey ( ) . getUuid ( ) . getUuid ( ) ) ) ) ; } new org.ovirt.engine.extension.aaa.jdbc.core.datasource.Sql.Modification ( updates ) . execute ( dataSource ) ; }

Target:
private static void modifySettings ( org.ovirt.engine.api.extensions.ExtMap settingKeys , javax.sql.DataSource dataSource ) throws java.sql.SQLException { java.util.List < java.lang.String > updates = new java.util.ArrayList < > ( ) ; for ( java.util.Map.Entry < org.ovirt.engine.api.extensions.ExtKey , java.lang.Object > entry : settingKeys.entrySet ( ) ) { updates.add ( org.ovirt.engine.extension.aaa.jdbc.Formatter.format ( "UPDATE settings SET value = WHERE uuid = {}" , org.ovirt.engine.extension.aaa.jdbc.Formatter.escapeString ( entry.getValue ( ) ) , org.ovirt.engine.extension.aaa.jdbc.Formatter.escapeString ( entry.getKey ( ) . getUuid ( ) . getUuid ( ) ) ) ) ; } new org.ovirt.engine.extension.aaa.jdbc.core.datasource.Sql.Modification ( updates ) . execute ( dataSource ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterGeoRepKeysUpdate ( java.util.List < java.lang.String > geoRepPubKeys , java.lang.String userName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepKeysUpdate" ) . withParameter ( "geoRepPubKeys" , geoRepPubKeys ) . withOptionalParameter ( "userName" , userName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn glusterGeoRepKeysUpdate ( java.util.List < java.lang.String > geoRepPubKeys , java.lang.String userName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepKeysUpdate" ) . withParameter ( "geoRepPubKeys" , geoRepPubKeys ) . withOptionalParameter ( "userName" , userName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn ( response ) ; }
Source:
public void testInvalidNumberOfMonitors ( ) { prepareVmToPassCanDoAction ( ) ; vmStatic.setNumOfMonitors ( 99 ) ; org.junit.Assert.assertFalse ( "canDoAction should have failed with invalid number of monitors." , command.canDoAction ( ) ) ; assertCanDoActionMessage ( EngineMessage.ACTION_TYPE_FAILED_ILLEGAL_NUM_OF_MONITORS ) ; }

Target:
public void testBlockSettingHaOnHostedEngine ( ) { prepareVmToPassValidate ( ) ; command.initEffectiveCompatibilityVersion ( ) ; vm.setOrigin ( OriginType.MANAGED_HOSTED_ENGINE ) ; vmStatic.setOrigin ( OriginType.MANAGED_HOSTED_ENGINE ) ; command.getParameters ( ) . getVm ( ) . setAutoStartup ( true ) ; boolean validInput = command.validate ( ) ; org.junit.Assert.assertFalse ( validInput ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_CANNOT_BE_HIGHLY_AVAILABLE_AND_HOSTED_ENGINE.name ( ) ) ) ; }
Source:
public void getStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }

Target:
public void getManagementNetworkCandidates ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > > aQuery , org.ovirt.engine.core.compat.Guid storagePoolId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( storagePoolId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetManagementNetworkCandidates , params , aQuery ) ; }
Source:
public void testStartingTheEngineWithNotEnoughSpares ( ) { parameters.put ( PolicyUnitParameter.HE_SPARES_COUNT.getDbName ( ) , "3" ) ; hostedEngine.setVmMemSizeMb ( 5000 ) ; hosts.get ( 2 ) . setHighlyAvailableLocalMaintenance ( true ) ; hosts.get ( 3 ) . setPhysicalMemMb ( 7000 ) ; hosts.get ( 4 ) . setPhysicalMemMb ( 2048 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = policyUnit.filter ( cluster , hosts , hostedEngine , parameters , messages ) ; org.junit.Assert.assertEquals ( 5 , result.size ( ) ) ; }

Target:
public void testStartingTheEngineWithNotEnoughSpares ( ) { parameters.put ( PolicyUnitParameter.HE_SPARES_COUNT.getDbName ( ) , "3" ) ; hostedEngine.setVmMemSizeMb ( 5000 ) ; hosts.get ( 2 ) . setHighlyAvailableLocalMaintenance ( true ) ; hosts.get ( 3 ) . setPhysicalMemMb ( 7000 ) ; hosts.get ( 4 ) . setPhysicalMemMb ( 2048 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = policyUnit.filter ( cluster , hosts , hostedEngine , parameters , messages ) ; org.junit.jupiter.api.Assertions.assertEquals ( 5 , result.size ( ) ) ; }
Source:
public void setCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { this . command = command ; command.getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { updateButton ( ) ; } } ) ; updateButton ( ) ; }

Target:
public void setCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { this . command = command ; command.getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { updateButton ( ) ; } } ) ; updateButton ( ) ; }
Source:
public void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) . withoutRefresh ( ) , aQuery ) ; }

Target:
public void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisksForVm , params , aQuery ) ; }
Source:
public void getClusterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClusterById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
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 ) ; }
Source:
public org.ovirt.engine.api.model.Spm adapt ( org.ovirt.engine.api.v3.types.V3SPM from ) { org.ovirt.engine.api.model.Spm to = new org.ovirt.engine.api.model.Spm ( ) ; if ( from.isSetPriority ( ) ) { to.setPriority ( from.getPriority ( ) ) ; } if ( from.isSetStatus ( ) ) { to.setStatus ( org.ovirt.engine.api.v3.adapters.V3InAdapters.adaptIn ( from.getStatus ( ) ) ) ; } return to ; }

Target:
public org.ovirt.engine.api.model.Spm adapt ( org.ovirt.engine.api.v3.types.V3SPM from ) { org.ovirt.engine.api.model.Spm to = new org.ovirt.engine.api.model.Spm ( ) ; if ( from.isSetPriority ( ) ) { to.setPriority ( from.getPriority ( ) ) ; } if ( ( from.isSetStatus ( ) ) && ( from.getStatus ( ) . isSetState ( ) ) ) { to.setStatus ( org.ovirt.engine.api.model.SpmStatus.fromValue ( from.getStatus ( ) . getState ( ) ) ) ; } return to ; }
Source:
public static java.util.List < java.lang.String > runAndAssertCanDoActionFailure ( org.ovirt.engine.core.bll.CommandBase < ? > command , org.ovirt.engine.core.dal.VdcBllMessages message ) { boolean canDoAction = command.canDoAction ( ) ; java.util.List < java.lang.String > canDoActionMessages = command.getReturnValue ( ) . getCanDoActionMessages ( ) ; org.junit.Assert.assertFalse ( "Command''s canDoAction expected to fail but succeed" , canDoAction ) ; org.junit.Assert.assertTrue ( java.text.MessageFormat.format ( "canDoAction messages doesn''t contain expected message: {0}, messages are: {1}" , message.name ( ) , canDoActionMessages ) , canDoActionMessages.contains ( message.name ( ) ) ) ; return canDoActionMessages ; }

Target:
public static java.util.List < java.lang.String > runAndAssertCanDoActionFailure ( org.ovirt.engine.core.bll.CommandBase < ? > command , org.ovirt.engine.core.dal.VdcBllMessages message ) { boolean canDoAction = command.canDoAction ( ) ; java.util.List < java.lang.String > canDoActionMessages = command.getReturnValue ( ) . getCanDoActionMessages ( ) ; org.junit.Assert.assertFalse ( "Command's canDoAction expected to fail, but succeeded" , canDoAction ) ; org.junit.Assert.assertTrue ( java.text.MessageFormat.format ( "canDoAction messages doesn''t contain expected message: {0}, messages are: {1}" , message.name ( ) , canDoActionMessages ) , canDoActionMessages.contains ( message.name ( ) ) ) ; return canDoActionMessages ; }
Source:
public void getoVirtISOsList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( id ) , aQuery ) ; }

Target:
public void getRoleActionGroupsByRoleId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid roleId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetRoleActionGroupsByRoleId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( roleId ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface lookupNic ( org.ovirt.engine.core.compat.Guid nicId ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > nics = getBackendCollection ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface.class , VdcQueryType.GetTemplateInterfacesByTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( instanceTypeId ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface nic : nics ) { if ( java.util.Objects.equals ( nic.getId ( ) , guid ) ) { return nic ; } } return null ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface lookupNic ( org.ovirt.engine.core.compat.Guid nicId ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > nics = getBackendCollection ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface.class , QueryType.GetTemplateInterfacesByTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( instanceTypeId ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface nic : nics ) { if ( java.util.Objects.equals ( nic.getId ( ) , guid ) ) { return nic ; } } return null ; }
Source:
public java.lang.Boolean runInTransaction ( ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.CollectVdsNetworkData , new org.ovirt.engine.core.common.vdscommands.CollectHostNetworkDataVdsCommandParameters ( getVds ( ) , getParameters ( ) . getInterfaces ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network net : getNetworks ( ) ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( getVdsGroupId ( ) , net ) ; } return java.lang.Boolean.TRUE ; }

Target:
public T runInTransaction ( ) { getDbFacade ( ) . getInterfaceDao ( ) . massUpdateInterfacesForVds ( getModifiedLabeledInterfaces ( ) ) ; return null ; }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.Device model , int index ) { assertEquals ( NAMES [ index ] , model.getName ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.BackendVmReportedDevicesResourceTest.PARENT_ID.toString ( ) , model.getVm ( ) . getId ( ) ) ; verifyIps ( model ) ; verifyLinks ( model ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.ReportedDevice model , int index ) { assertEquals ( NAMES [ index ] , model.getName ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.BackendVmReportedDevicesResourceTest.PARENT_ID.toString ( ) , model.getVm ( ) . getId ( ) ) ; verifyIps ( model ) ; verifyLinks ( model ) ; }
Source:
protected org.ovirt.engine.api.model.VM deprecatedPopulate ( org.ovirt.engine.api.model.VM model , org.ovirt.engine.api.model.VM entity ) { java.util.Set < java.lang.String > details = org.ovirt.engine.api.common.util.DetailHelper.getDetails ( httpHeaders , uriInfo ) ; model = addInlineDetails ( details , model ) ; if ( details.contains ( "statistics" ) ) { addInlineStatistics ( model ) ; } return model ; }

Target:
protected org.ovirt.engine.api.model.Vm doPopulate ( org.ovirt.engine.api.model.Vm model , org.ovirt.engine.api.restapi.resource.VM entity ) { setPayload ( model ) ; org.ovirt.engine.api.restapi.resource.MemoryPolicyHelper.setupMemoryBalloon ( model , this ) ; setConsoleDevice ( model ) ; setVirtioScsiController ( model ) ; setSoundcard ( model ) ; setCertificateInfo ( model ) ; setVmOvfConfiguration ( model , entity ) ; setRngDevice ( model ) ; return model ; }
Source:
public void testValidateQosOverriddenInterfacesWhenAttachmentDoesNotHaveQosOverridden ( ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder ( ) . addNetworkAttachments ( networkAttachment ) ) . build ( ) ; org.junit.Assert.assertThat ( validator.validateQosOverriddenInterfaces ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testValidateQosOverriddenInterfacesWhenAttachmentDoesNotHaveQosOverridden ( ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder ( ) . addNetworkAttachments ( networkAttachment ) ) . build ( ) ; org.hamcrest.MatcherAssert.assertThat ( validator.validateQosOverriddenInterfaces ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
protected void ExecuteIrsBrokerCommand ( ) { status = org.ovirt.engine.core.vdsbroker.irsbroker.AttachStorageDomainVDSCommand.getIrsProxy ( ) . attachStorageDomain ( org.ovirt.engine.core.vdsbroker.irsbroker.AttachStorageDomainVDSCommand.getParameters ( ) . getStorageDomainId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.AttachStorageDomainVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.AttachStorageDomainVDSCommand.proceedProxyReturnValue ( ) ; }

Target:
protected void executeIrsBrokerCommand ( ) { status = org.ovirt.engine.core.vdsbroker.irsbroker.AttachStorageDomainVDSCommand.getIrsProxy ( ) . attachStorageDomain ( org.ovirt.engine.core.vdsbroker.irsbroker.AttachStorageDomainVDSCommand.getParameters ( ) . getStorageDomainId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.AttachStorageDomainVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.AttachStorageDomainVDSCommand.proceedProxyReturnValue ( ) ; }
Source:
protected void verify ( org.ovirt.engine.api.model.GlusterBrick model , org.ovirt.engine.api.model.GlusterBrick transform ) { org.junit.Assert.assertNotNull ( transform ) ; org.junit.Assert.assertNotNull ( transform.getServerId ( ) ) ; org.junit.Assert.assertEquals ( model.getServerId ( ) , transform.getServerId ( ) ) ; org.junit.Assert.assertNotNull ( transform.getBrickDir ( ) ) ; org.junit.Assert.assertEquals ( model.getBrickDir ( ) , transform.getBrickDir ( ) ) ; }

Target:
protected void verify ( org.ovirt.engine.api.model.GlusterBrick model , org.ovirt.engine.api.model.GlusterBrick transform ) { org.junit.jupiter.api.Assertions.assertNotNull ( transform ) ; org.junit.jupiter.api.Assertions.assertNotNull ( transform.getServerId ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( model.getServerId ( ) , transform.getServerId ( ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( transform.getBrickDir ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( model.getBrickDir ( ) , transform.getBrickDir ( ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { createSpmControls ( object ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicommonweb.models.ListModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.ListModel ) ( sender ) ) ; java.util.List items = ( ( java.util.List ) ( model.getItems ( ) ) ) ; java.lang.Object selectedItem = model.getSelectedItem ( ) ; updatePmPanelsVisibility ( ( ( items.indexOf ( selectedItem ) ) == 0 ) ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ) ) ; return diskImage.isShareable ( ) ? resources.shareableDiskIcon ( ) : null ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.Disk disk = ( ( org.ovirt.engine.core.common.businessentities.Disk ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ) ) ; setTitle ( ( disk.isBoot ( ) ? constants.bootableDisk ( ) : null ) ) ; return disk.isBoot ( ) ? resources.bootableDiskIcon ( ) : null ; }
Source:
public static void IsBackendAvailable ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ; } } ; org.ovirt.engine.core.common.queries.GetDomainListParameters tempVar = new org.ovirt.engine.core.common.queries.GetDomainListParameters ( ) ; tempVar.setFilterInternalDomain ( true ) ; org.ovirt.engine.ui.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetDomainList , tempVar , aQuery ) ; }

Target:
public static java.util.Map < org.ovirt.engine.core.common.EventNotificationEntity , java.util.HashSet < org.ovirt.engine.core.common.AuditLogType > > GetAvailableNotificationEvents ( ) { return org.ovirt.engine.core.common.VdcEventNotificationUtils.GetNotificationEvents ( ) ; }
Source:
public void setColumnVisible ( com.google.gwt.user.cellview.client.Column < T , ? > column , boolean visible ) { if ( isColumnPresent ( column ) ) { columnVisibleMapOverride.put ( column , visible ) ; java.lang.String columnWidth = ( ( getHiddenPersistedColumnWidth ( column ) ) != null ) ? getHiddenPersistedColumnWidth ( column ) : columnWidthMap.get ( column ) ; persistColumnVisibility ( column , visible ) ; ensureColumnVisible ( column , null , visible , columnWidth , false ) ; } }

Target:
public void setColumnVisible ( com.google.gwt.user.cellview.client.Column < T , ? > column , boolean visible ) { if ( isColumnPresent ( column ) ) { columnVisibleMapOverride.put ( column , visible ) ; java.lang.String persistedWidth = getHiddenPersistedColumnWidth ( column ) ; java.lang.String columnWidth = ( persistedWidth != null ) ? persistedWidth : columnWidthMap.get ( column ) ; persistColumnVisibility ( column , visible ) ; ensureColumnVisible ( column , null , visible , columnWidth , false ) ; } }
Source:
protected boolean verifyAddVM ( ) { return org.ovirt.engine.core.bll.VmHandler.VerifyAddVm ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , ( ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getParameters ( ) . getVmsCount ( ) ) * ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getVmNetworkInterfaceDao ( ) . getAllForTemplate ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getVmTemplateId ( ) ) . size ( ) ) ) , org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getParameters ( ) . getVmStaticData ( ) . getpriority ( ) ) ; }

Target:
protected boolean verifyAddVM ( ) { return org.ovirt.engine.core.bll.VmHandler.VerifyAddVm ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , ( ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getParameters ( ) . getVmsCount ( ) ) * ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getVmNetworkInterfaceDao ( ) . getAllForTemplate ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getVmTemplateId ( ) ) . size ( ) ) ) , org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getParameters ( ) . getVmStaticData ( ) . getPriority ( ) ) ; }
Source:
public void testNetworkExists ( ) throws java.lang.Exception { org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator networkAttachmentValidatorSpy = org.mockito.Mockito.spy ( createNetworkAttachmentValidator ( new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ) ) ; org.mockito.Mockito.doReturn ( networkValidatorMock ) . when ( networkAttachmentValidatorSpy ) . getNetworkValidator ( ) ; org.mockito.Mockito.when ( networkValidatorMock.networkIsSet ( ) ) . thenReturn ( ValidationResult.VALID ) ; org.junit.Assert.assertThat ( "ValidationResult is not correctly propagated" , networkAttachmentValidatorSpy.networkExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testValidateGatewayWhenGatewayIsNull ( ) { doTestValidateGateway ( null , false , true , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void validateSucceedsWithForceOption ( ) throws java.lang.Exception { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveVdsCommand ( new org.ovirt.engine.core.common.action.RemoveVdsParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , true ) , null ) ) ; prepareMocks ( ) ; mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockVdsDynamic ( ) ; mockVmsPinnedToHost ( java.util.Collections.emptyList ( ) ) ; mockIsGlusterEnabled ( true ) ; mockHasVolumeOnServer ( true ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }

Target:
public void validateFailsWhenGlusterHostHasVolumes ( ) throws java.lang.Exception { mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockVdsDynamic ( ) ; mockVmsPinnedToHost ( java.util.Collections.emptyList ( ) ) ; mockIsGlusterEnabled ( true ) ; mockHasVolumeOnServer ( true ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.VDS_CANNOT_REMOVE_HOST_HAVING_GLUSTER_VOLUME ) ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; }

Target:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; }
Source:
public void onSuccess ( java.lang.Object model1 , java.lang.Object ReturnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disks = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ; java.util.Collections.sort ( disks , new org.ovirt.engine.ui.uicommonweb.Linq.DiskByAliasComparer ( ) ) ; org.ovirt.engine.ui.uicommonweb.models.SearchableListModel searchableListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( model1 ) ) ; searchableListModel.setItems ( disks ) ; }

Target:
public void onSuccess ( java.lang.Object model1 , java.lang.Object ReturnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disks = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > diskList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; diskList.addAll ( disks ) ; java.util.Collections.sort ( diskList , new org.ovirt.engine.ui.uicommonweb.Linq.DiskByAliasComparer ( ) ) ; org.ovirt.engine.ui.uicommonweb.models.SearchableListModel searchableListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( model1 ) ) ; searchableListModel.setItems ( diskList ) ; }
Source:
public void invoke ( org.ovirt.engine.api.extensions.ExtMap context , java.util.Map < java.lang.String , java.lang.Object > args ) { if ( ! ( context.containsKey ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.EXIT_STATUS ) ) ) { context.put ( Schema.InvokeKeys.MODIFICATION_TYPE , Sql.ModificationTypes.UPDATE ) ; context.put ( Schema.InvokeKeys.ENTITY_KEYS , new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Schema.UserIdentifiers.USERNAME , context.get ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.POSITIONAL ) ) . mput ( Schema.UserKeys.UNLOCK_TIME , new java.util.Date ( ) . getTime ( ) ) ) ; org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.commands.get ( "_schema-modify" ) . invoke ( context ) ; context.putIfAbsent ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.EXIT_STATUS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.SUCCESS ) ; } }

Target:
public void invoke ( org.ovirt.engine.api.extensions.ExtMap context , java.util.Map < java.lang.String , java.lang.Object > args ) { context.mput ( Schema.InvokeKeys.MODIFICATION_TYPE , Sql.ModificationTypes.UPDATE ) ; context.put ( Schema.InvokeKeys.ENTITY_KEYS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.getGroupKeys ( args , context.get ( ContextKeys.POSITIONAL , java.lang.String.class ) ) ) ; if ( ! ( context.containsKey ( ContextKeys.EXIT_STATUS ) ) ) { org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.commands.get ( "_schema-modify" ) . invoke ( context ) ; context.putIfAbsent ( ContextKeys.EXIT_STATUS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.SUCCESS ) ; } }
Source:
public void getAllowClusterWithVirtGlusterEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : java.lang.Boolean.TRUE ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.AllowClusterWithVirtGlusterEnabled , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getAllowClusterWithVirtGlusterEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery < java.lang.Boolean > aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.DefaultValueConverter < > ( java.lang.Boolean.TRUE ) ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.AllowClusterWithVirtGlusterEnabled , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void testListLimitResultsBadFormat ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectationsWithMax ( true ) ; setUpEntityQueryExpectations ( QueryType.GetAllTags , org.ovirt.engine.core.common.queries.QueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.setUpTags ( ) , null ) ; collection.setUriInfo ( uriInfo ) ; getCollection ( ) ; fail ( "Expected WebFaultException" ) ; }

Target:
public void testListLimitResultsBadFormat ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectationsWithMax ( true ) ; setUpEntityQueryExpectations ( QueryType.GetAllTags , org.ovirt.engine.core.common.queries.QueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.setUpTags ( ) , null ) ; collection.setUriInfo ( uriInfo ) ; getCollection ( ) ; org.junit.Assert.fail ( "Expected WebFaultException" ) ; }
Source:
public void invalidVmLeasesQueryForBackupDomain ( ) { org.ovirt.engine.core.common.queries.QueryReturnValue ret = new org.ovirt.engine.core.common.queries.QueryReturnValue ( ) ; ret.setSucceeded ( false ) ; org.mockito.Mockito.doReturn ( ret ) . when ( validator ) . getEntitiesWithLeaseIdForStorageDomain ( org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.Assert.assertThat ( validator.isRunningVmsOrVmLeasesForBackupDomain ( vmHandler ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_RETRIEVE_VMS_FOR_WITH_LEASES ) ) ; }

Target:
public void invalidVmLeasesQueryForBackupDomain ( ) { org.ovirt.engine.core.common.queries.QueryReturnValue ret = new org.ovirt.engine.core.common.queries.QueryReturnValue ( ) ; ret.setSucceeded ( false ) ; org.mockito.Mockito.doReturn ( ret ) . when ( validator ) . getEntitiesWithLeaseIdForStorageDomain ( org.mockito.ArgumentMatchers.any ( ) ) ; org.hamcrest.MatcherAssert.assertThat ( validator.isRunningVmsOrVmLeasesForBackupDomain ( vmHandler ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_RETRIEVE_VMS_FOR_WITH_LEASES ) ) ; }
Source:
private boolean isDomainHasStorageSpaceForRequest ( ) { return validate ( new org.ovirt.engine.core.bll.validator.StorageDomainValidator ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getStorageDomain ( ) ) . isDomainHasSpaceForRequest ( java.lang.Math.round ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) . getActualDiskWithSnapshotsSize ( ) ) ) ) ; }

Target:
protected boolean validateSpaceRequirements ( ) { org.ovirt.engine.core.bll.validator.StorageDomainValidator storageDomainValidator = createStorageDomainValidator ( ) ; if ( validate ( storageDomainValidator.isDomainWithinThresholds ( ) ) ) { org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) . getSnapshots ( ) . addAll ( getAllImageSnapshots ( ) ) ; return validate ( storageDomainValidator.hasSpaceForClonedDisk ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) ) ) ; } return false ; }
Source:
public void setUsePatternFly ( final boolean use ) { super . setUsePatternFly ( use ) ; if ( use ) { getCheckboxWidgetLabel ( ) . getStyle ( ) . setPaddingLeft ( 10 , Unit.PX ) ; getCheckboxWidgetLabel ( ) . getStyle ( ) . setPaddingRight ( 10 , Unit.PX ) ; getCheckboxWidgetLabel ( ) . getStyle ( ) . setPosition ( Position.RELATIVE ) ; getCheckboxWidgetLabel ( ) . getStyle ( ) . setProperty ( org.ovirt.engine.ui.common.widget.editor.BaseEntityModelCheckboxEditor.MAX_WIDTH , "95%" ) ; noPaddingNoFixes ( ) ; org.ovirt.engine.ui.common.widget.editor.BaseEntityModelCheckboxEditor.removeWrapperStyleName ( org.ovirt.engine.ui.common.widget.editor.BaseEntityModelCheckboxEditor.CBE_RIGHT_OF_LABEL_PFLY_FIX ) ; } }

Target:
public void setUsePatternFly ( final boolean use ) { super . setUsePatternFly ( use ) ; if ( use ) { getCheckboxWidgetLabel ( ) . getStyle ( ) . setPaddingLeft ( 10 , Unit.PX ) ; getCheckboxWidgetLabel ( ) . getStyle ( ) . setPaddingRight ( 10 , Unit.PX ) ; getCheckboxWidgetLabel ( ) . getStyle ( ) . setPosition ( Position.RELATIVE ) ; getCheckboxWidgetLabel ( ) . getStyle ( ) . setProperty ( org.ovirt.engine.ui.common.widget.editor.BaseEntityModelCheckboxEditor.MAX_WIDTH , "94%" ) ; noPaddingNoFixes ( ) ; org.ovirt.engine.ui.common.widget.editor.BaseEntityModelCheckboxEditor.removeWrapperStyleName ( org.ovirt.engine.ui.common.widget.editor.BaseEntityModelCheckboxEditor.CBE_RIGHT_OF_LABEL_PFLY_FIX ) ; } }
Source:
public void validate ( ) { validateCommon ( ) ; validateSmtp ( ) ; validateFilter ( ) ; }

Target:
private void validateCommon ( ) { requireAll ( org.ovirt.engine.core.notifier.utils.NotificationProperties.DAYS_TO_KEEP_HISTORY , org.ovirt.engine.core.notifier.utils.NotificationProperties.DAYS_TO_SEND_ON_STARTUP , org.ovirt.engine.core.notifier.utils.NotificationProperties.FAILED_QUERIES_NOTIFICATION_THRESHOLD , org.ovirt.engine.core.notifier.utils.NotificationProperties.ENGINE_INTERVAL_IN_SECONDS , org.ovirt.engine.core.notifier.utils.NotificationProperties.ENGINE_TIMEOUT_IN_SECONDS , org.ovirt.engine.core.notifier.utils.NotificationProperties.INTERVAL_IN_SECONDS , org.ovirt.engine.core.notifier.utils.NotificationProperties.IS_HTTPS_PROTOCOL , org.ovirt.engine.core.notifier.utils.NotificationProperties.REPEAT_NON_RESPONSIVE_NOTIFICATION , org.ovirt.engine.core.notifier.utils.NotificationProperties.IDLE_INTERVAL ) ; for ( java.lang.String property : new java.lang.String [ ] { org.ovirt.engine.core.notifier.utils.NotificationProperties.DAYS_TO_KEEP_HISTORY , org.ovirt.engine.core.notifier.utils.NotificationProperties.DAYS_TO_SEND_ON_STARTUP , org.ovirt.engine.core.notifier.utils.NotificationProperties.FAILED_QUERIES_NOTIFICATION_THRESHOLD , org.ovirt.engine.core.notifier.utils.NotificationProperties.IDLE_INTERVAL } ) { validateNonNegetive ( property ) ; } }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateWatchdog , org.ovirt.engine.core.common.action.WatchdogParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmWatchdogResourceTest.VM_ID } , true , true ) ) ; org.ovirt.engine.api.model.Watchdog wd = resource.update ( getUpdate ( ) ) ; assertTrue ( wd.isSetAction ( ) ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateWatchdog , org.ovirt.engine.core.common.action.WatchdogParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmWatchdogResourceTest.VM_ID } , true , true ) ) ; org.ovirt.engine.api.model.Watchdog wd = resource.update ( getUpdate ( ) ) ; org.junit.Assert.assertTrue ( wd.isSetAction ( ) ) ; }
Source:
public static void GetClusterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { 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.VDSGroup > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "Cluster: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.Cluster ) , aQuery ) ; }

Target:
public static void getClusterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { 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.VDSGroup > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "Cluster: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.Cluster ) , aQuery ) ; }
Source:
public void saveNewSanStorage ( ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel ) ( getWindow ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModel sanStorageModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModel ) ( model.getCurrentStorageItem ( ) ) ) ; java.util.ArrayList < java.lang.String > usedLunsMessages = sanStorageModel.getUsedLunsMessages ( ) ; if ( usedLunsMessages.isEmpty ( ) ) { onSaveSanStorage ( ) ; } else { forceCreationWarning ( usedLunsMessages ) ; } }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue response = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) ; if ( response.getSucceeded ( ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > checkedLuns = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > ) ( response.getReturnValue ( ) ) ) ; postGetLunsMessages ( sanStorageModel.getUsedLunsMessages ( checkedLuns ) ) ; } else { sanStorageModel.setGetLUNsFailure ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . couldNotRetrieveLUNsLunsFailure ( ) ) ; } }
Source:
public void testRemoveNotFound ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetAllNetworks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.core.compat.Guid.Empty } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
protected org.ovirt.engine.api.model.Network getEntity ( int index ) { org.ovirt.engine.api.model.Network entity = org.mockito.Mockito.mock ( org.ovirt.engine.api.model.Network.class ) ; org.mockito.Mockito.when ( entity.getId ( ) ) . thenReturn ( GUIDS [ index ] ) ; org.mockito.Mockito.when ( entity.getName ( ) ) . thenReturn ( NAMES [ index ] ) ; org.mockito.Mockito.when ( entity.getDescription ( ) ) . thenReturn ( DESCRIPTIONS [ index ] ) ; org.mockito.Mockito.when ( entity.getDataCenterId ( ) ) . thenReturn ( GUIDS [ 1 ] ) ; return entity ; }
Source:
public void networkDidntChange ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface nic = createNic ( "nic0" , "net" ) ; mockExistingIfaces ( nic ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic ) ) ; validateAndExpectNoViolations ( helper ) ; assertNoBondsModified ( helper ) ; assertNoNetworksModified ( helper ) ; assertNoNetworksRemoved ( helper ) ; assertNoBondsRemoved ( helper ) ; }

Target:
private void validateAndAssertNoChanges ( org.ovirt.engine.core.bll.SetupNetworksHelper helper ) { validateAndExpectNoViolations ( helper ) ; assertNoBondsModified ( helper ) ; assertNoNetworksModified ( helper ) ; assertNoNetworksRemoved ( helper ) ; assertNoBondsRemoved ( helper ) ; }