auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Cdrom model = new org.ovirt.engine.api.model.Cdrom ( ) ; model.setName ( NAMES [ 0 ] ) ; model.setFile ( new org.ovirt.engine.api.model.File ( ) ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Cdrom" , "add" , "file.id" ) ; } }

Target:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Cdrom model = new org.ovirt.engine.api.model.Cdrom ( ) ; model.setName ( NAMES [ 0 ] ) ; model.setFile ( new org.ovirt.engine.api.model.File ( ) ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; org.junit.Assert.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Cdrom" , "add" , "file.id" ) ; } }
Source:
public static void getRpmVersionViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getRpmVersion ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion ) ; tempVar.setVersion ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }
Source:
public void validateSucceedsWithStopActionTypeAndClusterIdAndServerId ( ) { cmd.getParameters ( ) . setActionType ( GlusterConstants.MANAGE_GLUSTER_SERVICE_ACTION_TYPE_STOP ) ; cmd.getParameters ( ) . setClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; cmd.getParameters ( ) . setServerId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; cmd.setClusterId ( cmd.getParameters ( ) . getClusterId ( ) ) ; cmd.setVdsId ( cmd.getParameters ( ) . getServerId ( ) ) ; prepareMocks ( ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; }

Target:
public void validateSucceedsWithStopActionTypeAndClusterIdAndServerId ( ) { cmd.getParameters ( ) . setActionType ( GlusterConstants.MANAGE_GLUSTER_SERVICE_ACTION_TYPE_STOP ) ; cmd.getParameters ( ) . setClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; cmd.getParameters ( ) . setServerId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; cmd.setClusterId ( cmd.getParameters ( ) . getClusterId ( ) ) ; cmd.setVdsId ( cmd.getParameters ( ) . getServerId ( ) ) ; prepareMocks ( ) ; org.junit.jupiter.api.Assertions.assertTrue ( cmd.validate ( ) ) ; }
Source:
private void CollapseAll ( ) { SetIsExpandedRecursively ( false , getItems ( ) . get ( 0 ) ) ; }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getResetCommand ( ) ) ) { reset ( ) ; } else if ( command == ( getExpandAllCommand ( ) ) ) { expandAll ( ) ; } else if ( command == ( getCollapseAllCommand ( ) ) ) { collapseAll ( ) ; } }
Source:
private void refreshCapabilities ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > list = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( java.lang.Object item : getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.VDS vds = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( item ) ) ; list.add ( new org.ovirt.engine.core.common.action.VdsActionParameters ( vds.getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( VdcActionType.RefreshHostCapabilities , list , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , null ) ; }

Target:
private void refreshCapabilities ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > list = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( java.lang.Object item : getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.VDS vds = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( item ) ) ; list.add ( new org.ovirt.engine.core.common.action.VdsActionParameters ( vds.getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.RefreshHostCapabilities , list , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , null ) ; }
Source:
private boolean networkAttachmentIsBeingRemoved ( java.lang.String interfaceName ) { for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment : params.getRemovedNetworkAttachments ( ) ) { if ( java.util.Objects.equals ( interfaceName , attachment.getNicName ( ) ) ) { return true ; } } return false ; }

Target:
private boolean bondIsUpdatedAndDoesNotContainCertainSlave ( java.lang.String slaveName , java.lang.String bondName ) { for ( org.ovirt.engine.core.common.businessentities.network.Bond bond : params.getBonds ( ) ) { boolean isRequiredBond = bond.getName ( ) . equals ( bondName ) ; if ( isRequiredBond ) { boolean updatedBondDoesNotContainGivenSlave = ! ( bond.getSlaves ( ) . contains ( slaveName ) ) ; return updatedBondDoesNotContainGivenSlave ; } } return false ; }
Source:
public static org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel.GraphicsTypes fromGraphicsTypes ( java.util.Collection < org.ovirt.engine.core.common.businessentities.GraphicsType > types ) { if ( types.containsAll ( java.util.Arrays.asList ( GraphicsType.SPICE , GraphicsType.VNC ) ) ) { return org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel.GraphicsTypes.SPICE_AND_VNC ; } else if ( types.contains ( GraphicsType.SPICE ) ) { return org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel.GraphicsTypes.SPICE ; } else if ( types.contains ( GraphicsType.VNC ) ) { return org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel.GraphicsTypes.VNC ; } return null ; }

Target:
private org.ovirt.engine.core.compat.Guid getSmallIconId ( java.lang.String newIcon , java.lang.String oldIcon , java.lang.String newOsDefaultIcon , org.ovirt.engine.core.compat.Guid newOsDefaultIconId ) { if ( newIcon.equals ( oldIcon ) ) { return getIcon ( ) . getEntity ( ) . getSmallIconId ( ) ; } if ( newIcon.equals ( newOsDefaultIcon ) ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getSmallByLargeOsDefaultIconId ( newOsDefaultIconId ) ; } return null ; }
Source:
public boolean eval ( org.ovirt.engine.core.common.businessentities.VM v ) { return ! ( hostId.equals ( v.getDedicatedVmForVds ( ) ) ) ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getPrimarySources ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > candidateHosts , java.util.Map < java.lang.String , java.lang.String > parameters ) { final int highUtilization = tryParseWithDefault ( parameters.get ( org.ovirt.engine.core.bll.scheduling.policyunits.EvenDistributionBalancePolicyUnit.HIGH_UTILIZATION ) , getHighUtilizationDefaultValue ( ) ) ; final int cpuOverCommitDurationMinutes = tryParseWithDefault ( parameters.get ( "CpuOverCommitDurationMinutes" ) , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.CpuOverCommitDurationMinutes ) ) ; return getOverUtilizedCPUHosts ( candidateHosts , highUtilization , cpuOverCommitDurationMinutes ) ; }
Source:
public boolean getIsAvailable ( ) { if ( ( getDetailModel ( ) . getEntity ( ) ) == null ) { return false ; } return ! ( ( ( org.ovirt.engine.core.common.businessentities.aaa.DbUser ) ( getDetailModel ( ) . getEntity ( ) ) ) . isGroup ( ) ) ; }

Target:
private boolean isUserElement ( org.ovirt.engine.ui.uicommonweb.models.users.UserGeneralModel userGeneralModel ) { if ( ( getDetailModel ( ) . getEntity ( ) ) == null ) { return false ; } return ! ( ( ( org.ovirt.engine.core.common.businessentities.aaa.DbUser ) ( getDetailModel ( ) . getEntity ( ) ) ) . isGroup ( ) ) ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > get64bitOsTypes ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.x64OsTypes ) != null ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.x64OsTypes ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.x64OsTypes = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.VmOsType [ ] { org.ovirt.engine.core.common.businessentities.VmOsType.RHEL3x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL4x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL5x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL6x64 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows2003x64 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows2008R2x64 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows2008x64 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows7x64 } ) ) ; return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.x64OsTypes ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > ( ) ; } return source ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.storage.VmBackupModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand == ( getModel ( ) . getRestoreCommand ( ) ) ) { return importVmPopupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.storage.TemplateBackupModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand == ( getModel ( ) . getRestoreCommand ( ) ) ) { return importTemplatePopupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }
Source:
protected void onReveal ( ) { super . onReveal ( ) ; if ( hasSelection ( ) ) { clearSelection ( ) ; } else { updateLayout ( ) ; } org.ovirt.engine.ui.webadmin.section.main.presenter.AbstractMainTabWithDetailsPresenter.getView ( ) . getTable ( ) . resetScrollPosition ( ) ; }

Target:
protected void onReveal ( ) { super . onReveal ( ) ; if ( hasSelection ( ) ) { clearSelection ( ) ; } else { updateLayout ( ) ; } org.ovirt.engine.ui.webadmin.section.main.presenter.AbstractMainTabWithDetailsPresenter.getView ( ) . getTable ( ) . resetScrollPosition ( ) ; org.ovirt.engine.ui.webadmin.section.main.presenter.AbstractMainTabWithDetailsPresenter.getView ( ) . getTable ( ) . setLoadingState ( LoadingState.LOADING ) ; }
Source:
protected org.ovirt.engine.core.common.utils.ToStringBuilder appendAttributes ( org.ovirt.engine.core.common.utils.ToStringBuilder tsb ) { return super . appendAttributes ( tsb ) . append ( "rollbackOnFailure" , isRollbackOnFailure ( ) ) . append ( "connectivityTimeout" , getConnectivityTimeout ( ) ) . append ( "networks" , org.ovirt.engine.core.common.businessentities.Entities.collectionToString ( getNetworks ( ) , "\t\t" ) ) . append ( "removedNetworks" , getRemovedNetworks ( ) ) . append ( "bonds" , org.ovirt.engine.core.common.businessentities.Entities.collectionToString ( getCreateOrUpdateBonds ( ) , "\t\t" ) ) . append ( "removedBonds" , getRemovedBonds ( ) ) ; }

Target:
protected org.ovirt.engine.core.common.utils.ToStringBuilder appendAttributes ( org.ovirt.engine.core.common.utils.ToStringBuilder tsb ) { return super . appendAttributes ( tsb ) . append ( "rollbackOnFailure" , isRollbackOnFailure ( ) ) . append ( "connectivityTimeout" , getConnectivityTimeout ( ) ) . append ( "networks" , org.ovirt.engine.core.common.businessentities.Entities.collectionToString ( getNetworks ( ) , "\t\t" ) ) . append ( "removedNetworks" , getRemovedNetworks ( ) ) . append ( "bonds" , org.ovirt.engine.core.common.businessentities.Entities.collectionToString ( getCreateOrUpdateBonds ( ) , "\t\t" ) ) . append ( "removedBonds" , getRemovedBonds ( ) ) . append ( "clusterSwitchType" , getClusterSwitchType ( ) ) ; }
Source:
public void canRemoveNonExistentBrick ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity = getDistributedVolume ( volumeId1 , 4 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricksToRemove = new java.util.ArrayList < > ( ) ; bricksToRemove.addAll ( getBricks ( volumeEntity.getId ( ) , 1 ) ) ; bricksToRemove.get ( 0 ) . setBrickDirectory ( "NewServer:/NewExport" ) ; org.ovirt.engine.core.bll.ValidationResult validationResult = brickValidator.canRemoveBrick ( bricksToRemove , volumeEntity , 1 , false ) ; org.junit.Assert.assertFalse ( validationResult.isValid ( ) ) ; org.junit.Assert.assertEquals ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_BRICK_INVALID , validationResult.getMessage ( ) ) ; }

Target:
public void canRemoveNonExistentBrick ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity = getDistributedVolume ( volumeId1 , 4 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricksToRemove = new java.util.ArrayList < > ( ) ; bricksToRemove.addAll ( getBricks ( volumeEntity.getId ( ) , 1 ) ) ; bricksToRemove.get ( 0 ) . setBrickDirectory ( "NewServer:/NewExport" ) ; org.ovirt.engine.core.bll.ValidationResult validationResult = brickValidator.canRemoveBrick ( bricksToRemove , volumeEntity , 1 , false ) ; org.junit.Assert.assertThat ( validationResult , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_BRICK_INVALID ) ) ; }
Source:
public static 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 ) ) . intValue ( ) : 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 ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public static void isVirtioScsiEnabledForVm ( 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 < ? > ) ( source ) ) . isEmpty ( ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVirtioScsiControllers , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
protected void onReset ( ) { super . onReset ( ) ; if ( ! ( hasReportsModelRefreshEvent ( ) ) ) { org.ovirt.engine.ui.webadmin.section.main.presenter.tab.MainTabReportsPresenter.reportsWebappDeployed = false ; getModel ( ) . getReportModelRefreshEvent ( ) . addListener ( new org.ovirt.engine.ui.webadmin.section.main.presenter.tab.MainTabReportsPresenter.ReportsModelRefreshEvent ( ) ) ; } setSubTabPanelVisible ( false ) ; getModel ( ) . refreshReportModel ( ) ; }

Target:
private boolean hasReportsModelRefreshEvent ( ) { for ( org.ovirt.engine.ui.uicompat.IEventListener listnr : ( ( java.util.List < org.ovirt.engine.ui.uicompat.IEventListener > ) ( getModel ( ) . getReportsAvailabilityEvent ( ) . getListeners ( ) ) ) ) { if ( listnr instanceof org.ovirt.engine.ui.webadmin.section.main.presenter.tab.MainTabReportsPresenter.ReportsModelRefreshEvent ) { return true ; } } return false ; }
Source:
protected boolean validateUsbPolicy ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getParameters ( ) . getVm ( ) ; org.ovirt.engine.core.bll.VmHandler.updateImportedVmUsbPolicy ( vm.getStaticData ( ) ) ; return org.ovirt.engine.core.bll.VmHandler.isUsbPolicyLegal ( vm.getUsbPolicy ( ) , vm.getOs ( ) , getVdsGroup ( ) , getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }

Target:
protected boolean validateUsbPolicy ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getParameters ( ) . getVm ( ) ; org.ovirt.engine.core.bll.VmHandler.updateImportedVmUsbPolicy ( vm.getStaticData ( ) ) ; return org.ovirt.engine.core.bll.VmHandler.isUsbPolicyLegal ( vm.getUsbPolicy ( ) , vm.getOs ( ) , org.ovirt.engine.core.bll.ImportVmCommand.getVdsGroup ( ) , getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }
Source:
protected void handleMemoryAdjustments ( ) { }

Target:
protected boolean isVmRunningOnNonDefaultVds ( ) { return ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getDedicatedVmForVds ( ) ) != null ) && ( ! ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getRunOnVds ( ) . equals ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getDedicatedVmForVds ( ) ) ) ) ; }
Source:
private void clearCommands ( ) { pauseCommand.setTarget ( null ) ; pauseCommand = null ; returnVmCommand.setTarget ( null ) ; returnVmCommand = null ; runCommand.setTarget ( null ) ; runCommand = null ; shutdownCommand.setTarget ( null ) ; shutdownCommand = null ; stopCommand.setTarget ( null ) ; stopCommand = null ; takeVmCommand.setTarget ( null ) ; takeVmCommand = null ; setCommands ( null ) ; }

Target:
private void clearCommands ( ) { pauseCommand.setTarget ( null ) ; pauseCommand = null ; returnVmCommand.setTarget ( null ) ; returnVmCommand = null ; runCommand.setTarget ( null ) ; runCommand = null ; shutdownCommand.setTarget ( null ) ; shutdownCommand = null ; stopCommand.setTarget ( null ) ; stopCommand = null ; takeVmCommand.setTarget ( null ) ; takeVmCommand = null ; rebootCommand.setTarget ( null ) ; rebootCommand = null ; setCommands ( null ) ; }
Source:
private static void addContextMessage ( org.ovirt.engine.api.extensions.ExtMap context , boolean error , java.lang.String message ) { org.ovirt.engine.api.extensions.ExtKey key ; if ( error ) { key = ContextKeys.ERR_MESSAGES ; } else { key = ContextKeys.OUT_MESSAGES ; } ( ( java.util.List < java.lang.String > ) ( context.get ( key , java.util.List.class ) ) ) . add ( message ) ; }

Target:
private static void addContextMessage ( org.ovirt.engine.api.extensions.ExtMap context , boolean error , java.lang.String message ) { org.ovirt.engine.api.extensions.ExtKey key ; if ( error ) { key = ContextKeys.ERR_MESSAGES ; } else { key = ContextKeys.OUT_MESSAGES ; } context.< java.util.List < java.lang.String > > get ( key ) . add ( message ) ; }
Source:
public static void initWindowsOsTypes ( ) { 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.windowsOsIds = ( ( java.util.ArrayList < java.lang.Integer > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetWindowsOss ) , callback ) ; }

Target:
public void initWindowsOsTypes ( ) { 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 ) { windowsOsIds = ( ( java.util.ArrayList < java.lang.Integer > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetWindowsOss ) , callback ) ; }
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.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; }

Target:
public void getHostListByCluster ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.VDS > > aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "Host: cluster = " + clusterName ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.VDS ) , aQuery ) ; }
Source:
private void insertServerService ( org.ovirt.engine.core.common.businessentities.VDS server , final org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService fetchedService ) { fetchedService.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; getGlusterServerServiceDao ( ) . save ( fetchedService ) ; org.ovirt.engine.core.bll.gluster.GlusterServiceSyncJob.log.infoFormat ( "Service {0} was not mapped to server {1}. Mapped it now." , fetchedService.getServiceName ( ) , server.getHostName ( ) ) ; logUtil.logAuditMessage ( server.getVdsGroupId ( ) , null , server , AuditLogType.GLUSTER_SERVICE_ADDED_TO_SERVER , new java.util.HashMap < java.lang.String , java.lang.String > ( ) { { put ( GlusterConstants.SERVICE_NAME , fetchedService.getServiceName ( ) ) ; } } ) ; }

Target:
private void insertServerService ( org.ovirt.engine.core.common.businessentities.VDS server , final org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService fetchedService ) { fetchedService.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; getGlusterServerServiceDao ( ) . save ( fetchedService ) ; org.ovirt.engine.core.bll.gluster.GlusterServiceSyncJob.log.infoFormat ( "Service {0} was not mapped to server {1}. Mapped it now." , fetchedService.getServiceName ( ) , server.getHostName ( ) ) ; logUtil.logAuditMessage ( server.getVdsGroupId ( ) , null , server , AuditLogType.GLUSTER_SERVICE_ADDED_TO_SERVER , new java.util.HashMap < java.lang.String , java.lang.String > ( ) { { put ( GlusterConstants.SERVICE_NAME , fetchedService.getServiceName ( ) ) ; } } ) ; }
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 < org.ovirt.engine.api.common.util.DetailHelper.Detail > details = org.ovirt.engine.api.common.util.DetailHelper.getDetails ( getHttpHeaders ( ) ) ; model = addInlineDetails ( details , model ) ; if ( details.contains ( Detail.STATISTICS ) ) { addInlineStatistics ( model ) ; } return model ; }

Target:
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 ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setAllContentHeaderExpectation ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmInterface , org.ovirt.engine.core.common.action.AddVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "Interface.Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID , GUIDS [ 1 ] } , true , true ) ) ; org.ovirt.engine.api.model.NIC nic = resource.update ( getNic ( false ) ) ; assertNotNull ( nic ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setAllContentHeaderExpectation ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmInterface , org.ovirt.engine.core.common.action.AddVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "Interface.Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID , GUIDS [ 1 ] } , true , true ) ) ; org.ovirt.engine.api.model.Nic nic = resource.update ( getNic ( false ) ) ; assertNotNull ( nic ) ; }
Source:
private org.ovirt.engine.core.common.action.PersistentSetupNetworksParameters createPersistentSetupNetworksParameters ( ) { return new org.ovirt.engine.core.bll.network.AddNetworksByLabelParametersBuilder ( org.ovirt.engine.core.bll.network.host.LabelNicCommand.getContext ( ) ) . buildParameters ( getNic ( ) , getLabel ( ) , getClusterNetworksWithLabel ( getLabel ( ) ) ) ; }

Target:
private org.ovirt.engine.core.common.action.HostSetupNetworksParameters createHostSetupNetworksParameters ( ) { org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( org.ovirt.engine.core.bll.network.host.LabelNicCommand.getVdsId ( ) ) ; params.getLabels ( ) . add ( new org.ovirt.engine.core.common.businessentities.network.NicLabel ( getNic ( ) . getId ( ) , getNic ( ) . getName ( ) , getLabel ( ) ) ) ; return params ; }
Source:
public java.lang.String get ( org.ovirt.engine.sdk.entities.DetailedLink link , java.lang.String key ) { return get ( makeKey ( link , key ) ) ; }

Target:
public java.util.List < java.lang.String > getList ( java.lang.String key ) { java.lang.String value = get ( key ) ; if ( ( value == null ) || ( value.isEmpty ( ) ) ) { return java.util.Collections.emptyList ( ) ; } return java.util.Arrays.asList ( value.split ( "\\s" ) ) ; }
Source:
private org.ovirt.engine.core.compat.Guid getClusterId ( org.ovirt.engine.api.model.Host host ) { return ( host.isSetCluster ( ) ) && ( host.getCluster ( ) . isSetId ( ) ) ? new org.ovirt.engine.core.compat.Guid ( host.getCluster ( ) . getId ( ) ) : getEntity ( org.ovirt.engine.core.common.businessentities.VDSGroup.class , SearchType.Cluster , ( "Cluster: name=" + ( ( host.isSetCluster ( ) ) && ( host.getCluster ( ) . isSetName ( ) ) ? host.getCluster ( ) . getName ( ) : "Default" ) ) ) . getId ( ) ; }

Target:
private org.ovirt.engine.core.compat.Guid getClusterIdByName ( java.lang.String name ) { return getEntity ( org.ovirt.engine.core.common.businessentities.VDSGroup.class , VdcQueryType.GetVdsGroupByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , ( "Cluster: name=" + name ) ) . getId ( ) ; }
Source:
public static 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 ) , aQuery ) ; }

Target:
public static 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.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) ; params.setRefresh ( false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmConfigurationBySnapshot , params , aQuery ) ; }
Source:
public void canDoActionFailsOnNoHook ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.AddGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID ) ) ) ; setUpMocksForAdd ( false ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_HOOK_DOES_NOT_EXIST.toString ( ) ) ) ; }

Target:
public void validateFailsOnNoHook ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.AddGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID ) ) ) ; setUpMocksForAdd ( false ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_HOOK_DOES_NOT_EXIST.toString ( ) ) ) ; }
Source:
private void completeGenerationInfo ( ) { if ( ! ( isDstVdsmImage ( ) ) ) { return ; } org.ovirt.engine.core.common.businessentities.VdsmImageLocationInfo info = ( ( org.ovirt.engine.core.common.businessentities.VdsmImageLocationInfo ) ( org.ovirt.engine.core.bll.storage.disk.image.CopyDataCommand.getParameters ( ) . getDstInfo ( ) ) ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage image = imagesHandler.getVolumeInfoFromVdsm ( org.ovirt.engine.core.bll.storage.disk.image.CopyDataCommand.getParameters ( ) . getStoragePoolId ( ) , info.getStorageDomainId ( ) , info.getImageGroupId ( ) , info.getImageId ( ) ) ; info.setGeneration ( image.getImage ( ) . getGeneration ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.CopyDataCommand.persistCommandIfNeeded ( ) ; }

Target:
private void completeGenerationInfo ( ) { if ( ! ( isDstVdsmImage ( ) ) ) { return ; } org.ovirt.engine.core.common.businessentities.VdsmImageLocationInfo info = ( ( org.ovirt.engine.core.common.businessentities.VdsmImageLocationInfo ) ( org.ovirt.engine.core.bll.storage.disk.image.CopyDataCommand.getParameters ( ) . getDstInfo ( ) ) ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage image = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.getVolumeInfoFromVdsm ( org.ovirt.engine.core.bll.storage.disk.image.CopyDataCommand.getParameters ( ) . getStoragePoolId ( ) , info.getStorageDomainId ( ) , info.getImageGroupId ( ) , info.getImageId ( ) ) ; info.setGeneration ( image.getImage ( ) . getGeneration ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.CopyDataCommand.persistCommandIfNeeded ( ) ; }
Source:
protected R resolveCreated ( org.ovirt.engine.core.common.action.VdcReturnValueBase result , org.ovirt.engine.api.restapi.resource.EntityIdResolver entityResolver , java.lang.Class < ? extends org.ovirt.engine.api.model.BaseResource > suggestedParentType ) { try { Q created = entityResolver.resolve ( ( ( org.ovirt.engine.core.compat.Guid ) ( result.getActionReturnValue ( ) ) ) ) ; return addLinks ( populate ( org.ovirt.engine.api.restapi.resource.AbstractBackendCollectionResource.map ( created ) , created ) , suggestedParentType ) ; } catch ( java.lang.Exception e ) { e.printStackTrace ( ) ; return null ; } }

Target:
protected < T > R resolveCreated ( org.ovirt.engine.core.common.action.VdcReturnValueBase result , org.ovirt.engine.api.restapi.resource.IResolver < T , Q > entityResolver , java.lang.Class < ? extends org.ovirt.engine.api.model.BaseResource > suggestedParentType ) { try { Q created = entityResolver.resolve ( ( ( T ) ( result.getActionReturnValue ( ) ) ) ) ; return addLinks ( populate ( org.ovirt.engine.api.restapi.resource.AbstractBackendCollectionResource.map ( created ) , created ) , suggestedParentType ) ; } catch ( java.lang.Exception e ) { e.printStackTrace ( ) ; return null ; } }
Source:
public T getParameters ( ) { return super . getParameters ( ) ; }

Target:
protected boolean setAndValidateCpuProfile ( ) { getVm ( ) . getStaticData ( ) . setVdsGroupId ( org.ovirt.engine.core.bll.ImportVmCommand.getVdsGroupId ( ) ) ; getVm ( ) . getStaticData ( ) . setCpuProfileId ( getParameters ( ) . getCpuProfileId ( ) ) ; return validate ( org.ovirt.engine.core.bll.profiles.CpuProfileHelper.setAndValidateCpuProfile ( getVm ( ) . getStaticData ( ) , org.ovirt.engine.core.bll.ImportVmCommand.getVdsGroup ( ) . getcompatibility_version ( ) ) ) ; }
Source:
public org.ovirt.engine.api.resource.StatisticsResource getStatisticsResource ( ) { org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > resolver = new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.GetDiskByDiskIdParameters.class ) ; org.ovirt.engine.api.restapi.resource.DiskStatisticalQuery query = new org.ovirt.engine.api.restapi.resource.DiskStatisticalQuery ( resolver , newModel ( id ) ) ; return inject ( new org.ovirt.engine.api.restapi.resource.BackendStatisticsResource < org.ovirt.engine.api.model.Disk , org.ovirt.engine.api.model.Disk > ( entityType , guid , query ) ) ; }

Target:
public org.ovirt.engine.api.resource.StatisticsResource getStatisticsResource ( ) { org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > resolver = new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ; org.ovirt.engine.api.restapi.resource.DiskStatisticalQuery query = new org.ovirt.engine.api.restapi.resource.DiskStatisticalQuery ( resolver , newModel ( id ) ) ; return inject ( new org.ovirt.engine.api.restapi.resource.BackendStatisticsResource < org.ovirt.engine.api.model.Disk , org.ovirt.engine.api.model.Disk > ( entityType , guid , query ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ev.equals ( RegistrationResult.RetrievedEventDefinition ) ) { AsyncResult_Retrieved ( ) ; } if ( ev.equals ( ProvideTickEvent.Definition ) ) { SyncSearch ( ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ev.matchesDefinition ( RegistrationResult.RetrievedEventDefinition ) ) { AsyncResult_Retrieved ( ) ; } if ( ev.matchesDefinition ( ProvideTickEvent.Definition ) ) { SyncSearch ( ) ; } }
Source:
public void StorageEventOnTimer ( org.ovirt.engine.core.common.businessentities.storage_pool storagePool , boolean _isSpmStartCalled ) { try { if ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . IsStoragePoolMasterUp ( _storagePoolId ) ) { org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getEventListener ( ) . storagePoolUpEvent ( storagePool , _isSpmStartCalled ) ; } } catch ( java.lang.RuntimeException exp ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.log.error ( "Error in StoragePoolUpEvent - " , exp ) ; } }

Target:
public void run ( ) { try { if ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . IsStoragePoolMasterUp ( _storagePoolId ) ) { org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getEventListener ( ) . storagePoolUpEvent ( storagePool , _isSpmStartCalled ) ; } } catch ( java.lang.RuntimeException exp ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.log.error ( "Error in StoragePoolUpEvent - " , exp ) ; } }
Source:
protected void alertPowerManagementStatusFailed ( java.lang.String reason ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase alert = org.ovirt.engine.core.di.Injector.injectMembers ( new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ) ; alert.setVdsId ( org.ovirt.engine.core.vdsbroker.vdsbroker.FenceVdsVDSCommand.getParameters ( ) . getTargetVdsID ( ) ) ; alert.addCustomValue ( "Reason" , reason ) ; auditLogDirector.log ( alert , AuditLogType.VDS_ALERT_FENCE_TEST_FAILED ) ; }

Target:
protected void alertPowerManagementStatusFailed ( java.lang.String reason ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable alert = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl ( ) ; alert.setVdsId ( org.ovirt.engine.core.vdsbroker.vdsbroker.FenceVdsVDSCommand.getParameters ( ) . getTargetVdsID ( ) ) ; alert.setVdsName ( getTargetVds ( ) . getName ( ) ) ; alert.addCustomValue ( "Reason" , reason ) ; auditLogDirector.log ( alert , AuditLogType.VDS_ALERT_FENCE_TEST_FAILED ) ; }
Source:
public void testValidateIpv4 ( ) { final org.ovirt.engine.ui.uicommonweb.validation.IpAddressValidation underTest = new org.ovirt.engine.ui.uicommonweb.validation.IpAddressValidationTest.MyIpAddressValidation ( ) ; final org.ovirt.engine.ui.uicommonweb.validation.ValidationResult actual = underTest.validate ( org.ovirt.engine.ui.uicommonweb.validation.IpAddressValidationTest.VALID_IPV4 ) ; org.junit.Assert.assertTrue ( actual.getSuccess ( ) ) ; org.junit.Assert.assertThat ( actual.getReasons ( ) , org.hamcrest.Matchers.emptyCollectionOf ( java.lang.String.class ) ) ; }

Target:
public void testValidateIpv4 ( ) { final org.ovirt.engine.ui.uicommonweb.validation.IpAddressValidation underTest = new org.ovirt.engine.ui.uicommonweb.validation.IpAddressValidationTest.MyIpAddressValidation ( ) ; final org.ovirt.engine.ui.uicommonweb.validation.ValidationResult actual = underTest.validate ( org.ovirt.engine.ui.uicommonweb.validation.IpAddressValidationTest.VALID_IPV4 ) ; org.junit.jupiter.api.Assertions.assertTrue ( actual.getSuccess ( ) ) ; org.hamcrest.MatcherAssert.assertThat ( actual.getReasons ( ) , org.hamcrest.Matchers.emptyCollectionOf ( java.lang.String.class ) ) ; }
Source:
public java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getVmImagesFromDb ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > allVmImages = new java.util.ArrayList < > ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > filteredDisks = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( vm.getDiskList ( ) , false , true , true ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : filteredDisks ) { allVmImages.addAll ( getAllImageSnapshots ( diskImage ) ) ; } return allVmImages ; }

Target:
public java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getVmImagesFromDb ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > allVmImages = new java.util.ArrayList < > ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > filteredDisks = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.filterImageDisks ( vm.getDiskList ( ) , false , true , true ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : filteredDisks ) { allVmImages.addAll ( getAllImageSnapshots ( diskImage ) ) ; } return allVmImages ; }
Source:
public void getNetworkLabelsByDataCenterId ( org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.ui.frontend.AsyncQuery query ) { query.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.SortedSet < java.lang.String > > ( ) { @ java.lang.Override public java.util.SortedSet < java.lang.String > Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { java.util.SortedSet < java.lang.String > sortedSet = new java.util.TreeSet < java.lang.String > ( new org.ovirt.engine.core.common.businessentities.comparators.LexoNumericComparator ( ) ) ; sortedSet.addAll ( ( ( java.util.Collection < java.lang.String > ) ( returnValue ) ) ) ; return sortedSet ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNetworkLabelsByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , query ) ; }

Target:
public void getNetworkLabelsByDataCenterId ( org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.ui.frontend.AsyncQuery query ) { query.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.SortedSet < java.lang.String > > ( ) { @ java.lang.Override public java.util.SortedSet < java.lang.String > convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { java.util.SortedSet < java.lang.String > sortedSet = new java.util.TreeSet ( new org.ovirt.engine.core.common.businessentities.comparators.LexoNumericComparator ( ) ) ; sortedSet.addAll ( ( ( java.util.Collection < java.lang.String > ) ( returnValue ) ) ) ; return sortedSet ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNetworkLabelsByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , query ) ; }
Source:
public void testGet ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetIscsiBondById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondNetworkResourceTest.ISCSI_BOND_ID } , getIscsiBondContainingNetwork ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetNetworkById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondNetworkResourceTest.NETWORK_ID } , getEntity ( 0 ) ) ; verifyModel ( resource.get ( ) , 0 ) ; }

Target:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , getIscsiBondContainingNetwork ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetNetworkById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondNetworkResourceTest.NETWORK_ID } , getEntityList ( ) ) ; verifyModel ( resource.get ( ) , 0 ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusDetailForXmlRpc glusterVolumeGeoRepStatusDetail ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > response = vdsServer.glusterVolumeGeoRepStatusDetail ( volumeName , slaveHost , slaveVolumeName ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusDetailForXmlRpc ( response ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepSessionList ( ) { try { java.util.Map < java.lang.String , java.lang.Object > response = vdsServer.glusterVolumeGeoRepSessionList ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void testTemplateReplaceProperty ( ) throws java.net.URISyntaxException { java.io.File testThemeRootPath = new java.io.File ( this . getClass ( ) . getClassLoader ( ) . getResource ( "./org/ovirt/engine/core/branding" ) . toURI ( ) . getPath ( ) ) ; java.io.File testThemePath = new java.io.File ( testThemeRootPath.getAbsoluteFile ( ) , "01-test.brand" ) ; org.ovirt.engine.core.branding.BrandingTheme theme1 = new org.ovirt.engine.core.branding.BrandingTheme ( testThemePath.getAbsolutePath ( ) , testThemeRootPath , 2 ) ; org.junit.Assert.assertTrue ( "Theme 1 should load" , theme1.load ( ) ) ; org.junit.Assert.assertFalse ( "should replace template should be false" , theme1.shouldReplaceWelcomePageSectionTemplate ( ) ) ; }

Target:
public void testTemplateReplaceProperty ( ) throws java.net.URISyntaxException { java.io.File testThemeRootPath = new java.io.File ( this . getClass ( ) . getClassLoader ( ) . getResource ( "./org/ovirt/engine/core/branding" ) . toURI ( ) . getPath ( ) ) ; java.io.File testThemePath = new java.io.File ( testThemeRootPath.getAbsoluteFile ( ) , "01-test.brand" ) ; org.ovirt.engine.core.branding.BrandingTheme theme1 = new org.ovirt.engine.core.branding.BrandingTheme ( testThemePath.getAbsolutePath ( ) , testThemeRootPath , 2 ) ; org.junit.jupiter.api.Assertions.assertTrue ( theme1.load ( ) , "Theme 1 should load" ) ; org.junit.jupiter.api.Assertions.assertFalse ( theme1.shouldReplaceWelcomePageSectionTemplate ( ) , "should replace template should be false" ) ; }