auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void disconnectFromStorage ( ) { org.ovirt.engine.core.common.vdscommands.ConnectStorageServerVDSCommandParameters connectionParametersForVdsm = createParametersForVdsm ( org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getParameters ( ) . getVdsId ( ) , org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getParameters ( ) . getStorageServerConnection ( ) . getstorage_type ( ) , org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getParameters ( ) . getStorageServerConnection ( ) ) ; boolean isDisconnectSucceeded = runVdsCommand ( VDSCommandType.DisconnectStorageServer , connectionParametersForVdsm ) . getSucceeded ( ) ; if ( ! isDisconnectSucceeded ) { log.warn ( ( "Failed to disconnect storage connection " + ( org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getParameters ( ) . getStorageServerConnection ( ) ) ) ) ; } }

Target:
protected void disconnectFromStorage ( ) { org.ovirt.engine.core.common.vdscommands.StorageServerConnectionManagementVDSParameters connectionParametersForVdsm = createParametersForVdsm ( org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getParameters ( ) . getVdsId ( ) , org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getConnection ( ) . getstorage_type ( ) , org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getConnection ( ) ) ; boolean isDisconnectSucceeded = runVdsCommand ( VDSCommandType.DisconnectStorageServer , connectionParametersForVdsm ) . getSucceeded ( ) ; if ( ! isDisconnectSucceeded ) { log.warn ( ( "Failed to disconnect storage connection " + ( org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getConnection ( ) ) ) ) ; } }
Source:
public void testUpdateVolumeStatusByName ( ) { org.junit.Assert.assertTrue ( existingDistVol.isOnline ( ) ) ; dao.updateVolumeStatusByName ( existingDistVol.getClusterId ( ) , existingDistVol.getName ( ) , GlusterStatus.DOWN ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = dao.getById ( existingDistVol.getId ( ) ) ; org.junit.Assert.assertNotNull ( volume ) ; org.junit.Assert.assertFalse ( volume.isOnline ( ) ) ; org.junit.Assert.assertNotEquals ( volume , existingDistVol ) ; existingDistVol.setStatus ( GlusterStatus.DOWN ) ; org.junit.Assert.assertEquals ( existingDistVol , volume ) ; }

Target:
public void testUpdateVolumeStatusByName ( ) { org.junit.jupiter.api.Assertions.assertTrue ( existingDistVol.isOnline ( ) ) ; dao.updateVolumeStatusByName ( existingDistVol.getClusterId ( ) , existingDistVol.getName ( ) , GlusterStatus.DOWN ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = dao.getById ( existingDistVol.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( volume ) ; org.junit.jupiter.api.Assertions.assertFalse ( volume.isOnline ( ) ) ; org.junit.jupiter.api.Assertions.assertNotEquals ( volume , existingDistVol ) ; existingDistVol.setStatus ( GlusterStatus.DOWN ) ; org.junit.jupiter.api.Assertions.assertEquals ( existingDistVol , volume ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.Collection < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > qos = ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > ) ( returnValue ) ) ; getQos ( ) . setItems ( qos ) ; getQos ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.findNetworkQosById ( qos , getNetwork ( ) . getQosId ( ) ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.Collection < org.ovirt.engine.core.common.businessentities.network.HostNetworkQos > qos = ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.network.HostNetworkQos > ) ( returnValue ) ) ; getQos ( ) . setItems ( qos ) ; getQos ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.findHostNetworkQosById ( qos , getNetwork ( ) . getQosId ( ) ) ) ; }
Source:
public boolean canDoAction ( ) { return true ; }

Target:
protected boolean removeCinderVolume ( int removedVolumeIndex ) { org.ovirt.engine.core.common.action.RemoveCinderDiskVolumeParameters param = org.ovirt.engine.core.bll.storage.RemoveCinderDiskCommand.getParameters ( ) . getChildCommandsParameters ( ) . get ( removedVolumeIndex ) ; try { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValueBase = getFutureRemoveCinderDiskVolume ( removedVolumeIndex ) . get ( ) ; if ( ( vdcReturnValueBase == null ) || ( ! ( vdcReturnValueBase.getSucceeded ( ) ) ) ) { handleExecutionFailure ( param.getRemovedVolume ( ) , vdcReturnValueBase ) ; return false ; } } catch ( java.lang.InterruptedException | java.util.concurrent.ExecutionException e ) { e.printStackTrace ( ) ; return false ; } return true ; }
Source:
private void doTestBootProtocolSetForDisplayNetworkWhenNullValuedIpConfigurationAndWhenNetworkClusterDisplayIsFalse ( boolean displayNetwork , org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher ) { org.ovirt.engine.core.common.businessentities.network.Network network = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; network.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setIpConfiguration ( null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForDisplayNetworkWhenNullValuedIpConfigurationAndWhenNetworkClusterDisplayIsFalse ( displayNetwork , matcher , network , attachment ) ; }

Target:
private void doTestBootProtocolSetForDisplayNetworkWhenNullValuedIpConfigurationAndWhenNetworkClusterDisplay ( boolean displayNetwork , org.ovirt.engine.core.common.businessentities.network.Network network , org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setIpConfiguration ( null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForDisplayNetworkWhenNullValuedIpConfigurationAndWhenNetworkClusterDisplay ( displayNetwork , matcher , network , attachment ) ; }
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.getInstance ( ) . runQuery ( VdcQueryType.GetRoleActionGroupsByRoleId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( roleId ) , aQuery ) ; }

Target:
public static void getStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }
Source:
public static void runAndAssertValidateSuccess ( org.ovirt.engine.core.bll.CommandBase < ? > command ) { boolean validate = command.validate ( ) ; java.util.List < java.lang.String > validationMessages = command.getReturnValue ( ) . getValidationMessages ( ) ; org.junit.Assert.assertTrue ( java.text.MessageFormat.format ( "Command''s validate expected to succeed, but failed, messages are: {0}" , validationMessages ) , validate ) ; org.junit.Assert.assertTrue ( java.text.MessageFormat.format ( "Command''s validate succeeded, but added the following messages: {0}" , validationMessages ) , validationMessages.isEmpty ( ) ) ; }

Target:
public static void runAndAssertValidateSuccess ( org.ovirt.engine.core.bll.CommandBase < ? > command ) { boolean validate = command.validate ( ) ; java.util.List < java.lang.String > validationMessages = command.getReturnValue ( ) . getValidationMessages ( ) ; org.junit.jupiter.api.Assertions.assertTrue ( validate , java.text.MessageFormat.format ( "Command''s validate expected to succeed, but failed, messages are: {0}" , validationMessages ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( validationMessages.isEmpty ( ) , java.text.MessageFormat.format ( "Command''s validate succeeded, but added the following messages: {0}" , validationMessages ) ) ; }
Source:
public void testValidateJsonProtocolForCluster ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDSGroup.class ) ; org.mockito.Mockito.when ( cluster.getCompatibilityVersion ( ) ) . thenReturn ( Version.v3_6 ) ; validator = mockHostForProtocol ( VdsProtocol.STOMP ) ; org.junit.Assert.assertThat ( validator.protocolIsNotXmlrpc ( cluster ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testValidateJsonProtocolForCluster ( ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.Cluster.class ) ; org.mockito.Mockito.when ( cluster.getCompatibilityVersion ( ) ) . thenReturn ( Version.v3_6 ) ; validator = mockHostForProtocol ( VdsProtocol.STOMP ) ; org.junit.Assert.assertThat ( validator.protocolIsNotXmlrpc ( cluster ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
void updateMenuItem ( com.google.gwt.user.client.ui.MenuItem item , org.ovirt.engine.ui.common.widget.action.ActionButtonDefinition < T > buttonDef , java.util.List selectedItems ) { item.setVisible ( ( ( buttonDef.isAccessible ( selectedItems ) ) && ( buttonDef.isVisible ( selectedItems ) ) ) ) ; item.setEnabled ( buttonDef.isEnabled ( selectedItems ) ) ; if ( ( buttonDef.getTooltip ( ) ) != null ) { org.ovirt.engine.ui.common.widget.tooltip.TooltipMixin.addTooltipToElement ( buttonDef.getTooltip ( ) , item.getElement ( ) ) ; } }

Target:
void updateMenuItem ( com.google.gwt.user.client.ui.MenuItem item , org.ovirt.engine.ui.common.widget.action.ActionButtonDefinition < T > buttonDef , java.util.List selectedItems ) { item.setVisible ( ( ( buttonDef.isAccessible ( selectedItems ) ) && ( buttonDef.isVisible ( selectedItems ) ) ) ) ; item.setEnabled ( buttonDef.isEnabled ( selectedItems ) ) ; if ( ( buttonDef.getTooltip ( ) ) != null ) { org.ovirt.engine.ui.common.widget.tooltip.ElementTooltipUtils.setTooltipOnElement ( buttonDef.getTooltip ( ) , item.getElement ( ) ) ; } }
Source:
public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getCommandEntityDao ( ) . saveOrUpdate ( cmdEntity ) ; return null ; }

Target:
public void updateCommandStatus ( org.ovirt.engine.core.compat.Guid commandId , org.ovirt.engine.core.common.asynctasks.AsyncTaskType taskType , org.ovirt.engine.core.compat.CommandStatus status ) { final org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity = get ( commandId ) ; if ( cmdEntity != null ) { cmdEntity.setCommandStatus ( status ) ; if ( ( taskType.equals ( AsyncTaskType.notSupported ) ) || ( cmdEntity.isCallBackEnabled ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getCommandEntityDao ( ) . saveOrUpdate ( cmdEntity ) ; } } }
Source:
protected void verifyOrigKernelParams ( org.ovirt.engine.core.common.businessentities.VM origVm , org.ovirt.engine.core.common.businessentities.VM vm ) { org.junit.Assert.assertEquals ( origVm.getInitrdUrl ( ) , vm.getInitrdUrl ( ) ) ; org.junit.Assert.assertEquals ( origVm.getKernelUrl ( ) , vm.getKernelUrl ( ) ) ; org.junit.Assert.assertEquals ( origVm.getKernelParams ( ) , vm.getKernelParams ( ) ) ; }

Target:
protected void verifyOrigKernelParams ( org.ovirt.engine.core.common.businessentities.VM origVm , org.ovirt.engine.core.common.businessentities.VM vm ) { org.junit.jupiter.api.Assertions.assertEquals ( origVm.getInitrdUrl ( ) , vm.getInitrdUrl ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( origVm.getKernelUrl ( ) , vm.getKernelUrl ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( origVm.getKernelParams ( ) , vm.getKernelParams ( ) ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.VM vm ) { org.ovirt.engine.core.common.scheduling.AffinityGroup affinityGroup = getEntity ( ) ; affinityGroup.getEntityIds ( ) . add ( asGuid ( vm.getId ( ) ) ) ; return performAction ( VdcActionType.EditAffinityGroup , new org.ovirt.engine.core.common.scheduling.parameters.AffinityGroupCRUDParameters ( affinityGroup.getId ( ) , affinityGroup ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Vm vm ) { org.ovirt.engine.core.common.scheduling.AffinityGroup affinityGroup = getEntity ( ) ; affinityGroup.getEntityIds ( ) . add ( asGuid ( vm.getId ( ) ) ) ; return performAction ( VdcActionType.EditAffinityGroup , new org.ovirt.engine.core.common.scheduling.parameters.AffinityGroupCRUDParameters ( affinityGroup.getId ( ) , affinityGroup ) ) ; }
Source:
public void testRemoveById ( ) { dao.remove ( new org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMapId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID , org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_DOMAIN_ID ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap > entries = dao.getAllByStorageDomainId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) ; for ( org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap entry : entries ) { org.junit.Assert.assertFalse ( entry.getStorageDomainId ( ) . equals ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_DOMAIN_ID ) ) ; } org.junit.Assert.assertNotNull ( entries ) ; org.junit.Assert.assertTrue ( entries.isEmpty ( ) ) ; }

Target:
public void testRemoveById ( ) { dao.remove ( new org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMapId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID , FixturesTool.STORAGE_DOMAIN_SCALE_SD5 ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap > entries = dao.getAllByStorageDomainId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) ; for ( org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap entry : entries ) { org.junit.Assert.assertFalse ( entry.getStorageDomainId ( ) . equals ( FixturesTool.STORAGE_DOMAIN_SCALE_SD5 ) ) ; } org.junit.Assert.assertNotNull ( entries ) ; org.junit.Assert.assertTrue ( entries.isEmpty ( ) ) ; }
Source:
protected void actualSave ( ) { flush ( ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( action , new org.ovirt.engine.core.common.action.ProviderParameters ( provider ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { sourceListModel.getSearchCommand ( ) . execute ( ) ; } } ) ; cancel ( ) ; }

Target:
protected void actualSave ( ) { flush ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( action , new org.ovirt.engine.core.common.action.ProviderParameters ( provider ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { if ( ( ( result.getReturnValue ( ) ) == null ) || ( ! ( result.getReturnValue ( ) . getSucceeded ( ) ) ) ) { return ; } sourceListModel.getSearchCommand ( ) . execute ( ) ; cancel ( ) ; } } ) ; }
Source:
public void networkExists ( ) { simulateVdsGroupExists ( ) ; org.mockito.Mockito.when ( mockNetworkDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( getNetwork ( ) ) ; org.mockito.Mockito.when ( mockNetworkClusterDao.get ( param.getNetworkCluster ( ) . getId ( ) ) ) . thenReturn ( param.getNetworkCluster ( ) ) ; assertCanDoActionFailure ( VdcBllMessages.NETWORK_ALREADY_ATTACHED_TO_CLUSTER.toString ( ) ) ; }

Target:
public void networkExists ( ) { simulateVdsGroupExists ( ) ; org.mockito.Mockito.when ( mockNetworkDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( getNetwork ( ) ) ; org.mockito.Mockito.when ( mockNetworkClusterDao.get ( param.getNetworkCluster ( ) . getId ( ) ) ) . thenReturn ( param.getNetworkCluster ( ) ) ; assertCanDoActionFailure ( EngineMessage.NETWORK_ALREADY_ATTACHED_TO_CLUSTER.toString ( ) ) ; }
Source:
public void loadVmsFromExportDomain ( ) { startProgress ( null ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsFromExportDomain , new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( getDataCenters ( ) . getSelectedItem ( ) . getId ( ) , exportDomain.getId ( ) ) , new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { updateVms ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . < java.util.List < org.ovirt.engine.core.common.businessentities.VM > > getReturnValue ( ) ) ; } } ) ) ; }

Target:
public void loadVmsFromExportDomain ( ) { clearProblem ( ) ; startProgress ( null ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsFromExportDomain , new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( getDataCenters ( ) . getSelectedItem ( ) . getId ( ) , exportDomain.getId ( ) ) , new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { updateVms ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . < java.util.List < org.ovirt.engine.core.common.businessentities.VM > > getReturnValue ( ) ) ; } } ) ) ; }
Source:
public void invalidQosMissingValues ( ) { org.ovirt.engine.core.common.businessentities.network.HostNetworkQos qos = new org.ovirt.engine.core.common.businessentities.network.HostNetworkQos ( ) ; qos.setOutAverageUpperlimit ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.HIGH_BANDWIDTH ) ; qos.setOutAverageRealtime ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.LOW_BANDWIDTH ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = qosValuesTest ( qos ) ; validateAndExpectViolation ( helper , VdcBllMessages.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_SETUP_NETWORKS_MISSING_VALUES , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; }

Target:
public void bridgePropertiesNonVm ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createManagementNetwork ( ) ; network.setVmNetwork ( false ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; iface.setCustomProperties ( createCustomProperties ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) , Version.v3_5 ) ; validateAndExpectViolation ( helper , EngineMessage.ACTION_TYPE_FAILED_NETWORK_CUSTOM_PROPERTIES_BAD_INPUT , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; }
Source:
private org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue checkAgentStatus ( org.ovirt.engine.core.common.businessentities.FenceAgent agent , org.ovirt.engine.core.common.businessentities.VDS proxyHost ) { org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue returnValue = null ; returnValue = fence ( FenceActionType.Status , agent , proxyHost ) ; if ( returnValue.getSucceeded ( ) ) { returnValue.setProxyHostUsed ( proxyHost ) ; returnValue.setFenceAgentUsed ( agent ) ; } return returnValue ; }

Target:
private org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue checkAgentStatus ( org.ovirt.engine.core.common.businessentities.FenceAgent agent , org.ovirt.engine.core.common.businessentities.VDS proxyHost ) { org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue returnValue = null ; returnValue = fence ( FenceActionType.STATUS , agent , proxyHost ) ; if ( returnValue.getSucceeded ( ) ) { returnValue.setProxyHostUsed ( proxyHost ) ; returnValue.setFenceAgentUsed ( agent ) ; } return returnValue ; }
Source:
private void setUpGetEntityExpectations ( ) throws java.lang.Exception { setUpGetEntityExpectations ( GUIDS [ 0 ] , false ) ; }

Target:
public void testListFailure ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; setUpQueryExpectations ( org.ovirt.engine.api.restapi.resource.BackendGroupsResourceTest.QUERY , org.ovirt.engine.api.restapi.resource.FAILURE ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertTrue ( ( ( wae.getResponse ( ) . getEntity ( ) ) instanceof org.ovirt.engine.api.model.Fault ) ) ; assertEquals ( mockl10n ( org.ovirt.engine.api.restapi.resource.FAILURE ) , ( ( org.ovirt.engine.api.model.Fault ) ( wae.getResponse ( ) . getEntity ( ) ) ) . getDetail ( ) ) ; } }
Source:
protected void verify ( org.ovirt.engine.api.model.OpenStackImage model , org.ovirt.engine.api.model.OpenStackImage transform ) { assertNotNull ( transform ) ; assertEquals ( model.getId ( ) , transform.getId ( ) ) ; assertEquals ( model.getName ( ) , transform.getName ( ) ) ; }

Target:
protected void verify ( org.ovirt.engine.api.model.OpenStackImage model , org.ovirt.engine.api.model.OpenStackImage transform ) { org.junit.Assert.assertNotNull ( transform ) ; org.junit.Assert.assertEquals ( model.getId ( ) , transform.getId ( ) ) ; org.junit.Assert.assertEquals ( model.getName ( ) , transform.getName ( ) ) ; }
Source:
protected java.util.Collection < org.ovirt.engine.core.common.businessentities.DiskImage > getDiskImagesFromConfiguration ( ) { if ( ( diskImagesFromConfiguration ) == null ) { diskImagesFromConfiguration = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( vmFromConfiguration.getDiskMap ( ) . values ( ) , false , true , true ) ; } return diskImagesFromConfiguration ; }

Target:
protected java.util.Collection < org.ovirt.engine.core.common.businessentities.DiskImage > getAdjustedDiskImagesFromConfiguration ( ) { if ( ( diskImagesFromConfiguration ) == null ) { diskImagesFromConfiguration = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( vmFromConfiguration.getDiskMap ( ) . values ( ) , false , true , true ) ; adjustDisksImageConfiguration ( diskImagesFromConfiguration ) ; } return diskImagesFromConfiguration ; }
Source:
private void setUpDiskValidations ( ) { org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( diskImagesValidator ) . diskImagesNotLocked ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( diskImagesValidator ) . diskImagesNotIllegal ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( multipleStorageDomainsValidator ) . allDomainsExistAndActive ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( multipleStorageDomainsValidator ) . allDomainsWithinThresholds ( ) ; }

Target:
private void setUpDiskValidations ( ) { org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( diskImagesValidator ) . diskImagesNotLocked ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( diskImagesValidator ) . diskImagesNotIllegal ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( multipleStorageDomainsValidator ) . allDomainsExistAndActive ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( multipleStorageDomainsValidator ) . allDomainsWithinThresholds ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( org.mockito.Matchers.anyList ( ) ) ; }
Source:
public void removeNetworkFromParameters ( org.ovirt.engine.core.common.action.PersistentSetupNetworksParameters params , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic , org.ovirt.engine.core.common.businessentities.network.Network net ) { if ( org.ovirt.engine.core.utils.NetworkUtils.isVlan ( net ) ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vlan = getVlanDevice ( params.getInterfaces ( ) , nic , net ) ; if ( vlan == null ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.NETWORK_LABEL_CONFLICT ) ; } else { params.getInterfaces ( ) . remove ( vlan ) ; } } else if ( org.apache.commons.lang.StringUtils.equals ( net.getName ( ) , nic.getNetworkName ( ) ) ) { nic.setNetworkName ( null ) ; } }

Target:
public void removeNetworkFromParameters ( org.ovirt.engine.core.common.action.PersistentSetupNetworksParameters params , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic , org.ovirt.engine.core.common.businessentities.network.Network net ) { if ( org.ovirt.engine.core.utils.NetworkUtils.isVlan ( net ) ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vlan = getVlanDevice ( params.getInterfaces ( ) , nic , net ) ; if ( vlan == null ) { throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.NETWORK_LABEL_CONFLICT ) ; } else { params.getInterfaces ( ) . remove ( vlan ) ; } } else if ( org.apache.commons.lang.StringUtils.equals ( net.getName ( ) , nic.getNetworkName ( ) ) ) { nic.setNetworkName ( null ) ; } }
Source:
public org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder addRemovedLabels ( java.lang.String ... removedLabels ) { if ( emptyParameters ( removedLabels ) ) { return this ; } if ( ( parameters.getRemovedLabels ( ) ) == null ) { parameters.setRemovedLabels ( new java.util.HashSet < java.lang.String > ( ) ) ; } parameters.getRemovedLabels ( ) . addAll ( java.util.Arrays.asList ( removedLabels ) ) ; return this ; }

Target:
public org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder addRemovedBonds ( org.ovirt.engine.core.compat.Guid ... ids ) { if ( nullParameters ( ids ) ) { return this ; } if ( ( parameters.getRemovedBonds ( ) ) == null ) { parameters.setRemovedBonds ( new java.util.HashSet < > ( ) ) ; } parameters.getRemovedBonds ( ) . addAll ( java.util.Arrays.asList ( ids ) ) ; return this ; }
Source:
protected void endWithFailure ( ) { if ( shouldEndSnapshotCreation ( ) ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = org.ovirt.engine.core.bll.RunVmCommand.getBackend ( ) . endAction ( VdcActionType.CreateAllSnapshotsFromVm , org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getImagesParameters ( ) . get ( 0 ) , org.ovirt.engine.core.bll.RunVmCommand.cloneContext ( ) . withoutExecutionContext ( ) . withoutLock ( ) ) ; setSucceeded ( vdcReturnValue.getSucceeded ( ) ) ; } else { super . endWithFailure ( ) ; } }

Target:
protected void endWithFailure ( ) { if ( shouldEndSnapshotCreation ( ) ) { org.ovirt.engine.core.common.action.ActionReturnValue actionReturnValue = org.ovirt.engine.core.bll.RunVmCommand.getBackend ( ) . endAction ( ActionType.CreateAllSnapshotsFromVm , org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getImagesParameters ( ) . get ( 0 ) , org.ovirt.engine.core.bll.RunVmCommand.cloneContext ( ) . withoutExecutionContext ( ) . withoutLock ( ) ) ; setSucceeded ( actionReturnValue.getSucceeded ( ) ) ; } else { super . endWithFailure ( ) ; } }
Source:
public static java.lang.Object getConfigValue ( org.ovirt.engine.core.common.queries.ConfigurationValues configValue , java.lang.String version , org.ovirt.engine.ui.frontend.IAsyncConverter converter ) { if ( converter == null ) { return null ; } org.ovirt.engine.core.compat.KeyValuePairCompat < org.ovirt.engine.core.common.queries.ConfigurationValues , java.lang.String > key = new org.ovirt.engine.core.compat.KeyValuePairCompat < org.ovirt.engine.core.common.queries.ConfigurationValues , java.lang.String > ( configValue , version ) ; return converter.Convert ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.cachedConfigValuesPreConvert.get ( key ) , null ) ; }

Target:
public java.lang.Object getConfigValue ( org.ovirt.engine.core.common.queries.ConfigurationValues configValue , java.lang.String version , org.ovirt.engine.ui.frontend.IAsyncConverter converter ) { if ( converter == null ) { return null ; } org.ovirt.engine.core.compat.KeyValuePairCompat < org.ovirt.engine.core.common.queries.ConfigurationValues , java.lang.String > key = new org.ovirt.engine.core.compat.KeyValuePairCompat < org.ovirt.engine.core.common.queries.ConfigurationValues , java.lang.String > ( configValue , version ) ; return converter.Convert ( cachedConfigValuesPreConvert.get ( key ) , null ) ; }
Source:
private static java.lang.String getRelativePath ( java.lang.Class < ? > clz ) { for ( java.lang.reflect.Method method : org.ovirt.engine.api.resource.SystemResource.class . getMethods ( ) ) { if ( ( method.getReturnType ( ) ) == clz ) { javax.ws.rs.Path annotation = method.getAnnotation ( javax.ws.rs.Path.class ) ; if ( annotation != null ) { return annotation.value ( ) ; } } } org.ovirt.engine.api.restapi.util.LinkHelper.log.error ( ( ( "Can\'t find relative path for class \"" + ( clz.getName ( ) ) ) + "\", will return null" ) ) ; return null ; }

Target:
public int hashCode ( ) { if ( ( ( service ) == null ) && ( ( parentService ) == null ) ) { return 0 ; } if ( ( service ) == null ) { return parentService.hashCode ( ) ; } if ( ( parentService ) == null ) { return service.hashCode ( ) ; } return ( 997 * ( service.hashCode ( ) ) ) ^ ( 991 * ( parentService.hashCode ( ) ) ) ; }
Source:
public void testDedicatedHostNotExist ( ) { prepareVmToPassCanDoAction ( ) ; org.mockito.Mockito.doReturn ( vdsDAO ) . when ( command ) . getVdsDAO ( ) ; vmStatic.setDedicatedVmForVds ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; junit.framework.Assert.assertFalse ( "canDoAction should have failed with invalid dedicated host." , command.canDoAction ( ) ) ; assertCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DEDICATED_VDS_NOT_IN_SAME_CLUSTER ) ; }

Target:
public void testDedicatedHostNotExist ( ) { prepareVmToPassCanDoAction ( ) ; org.mockito.Mockito.doReturn ( vdsDAO ) . when ( command ) . getVdsDAO ( ) ; vmStatic.setDedicatedVmForVds ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertFalse ( "canDoAction should have failed with invalid dedicated host." , command.canDoAction ( ) ) ; assertCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DEDICATED_VDS_NOT_IN_SAME_CLUSTER ) ; }
Source:
public boolean isIsoVersionCompatible ( org.ovirt.engine.core.compat.RpmVersion ovirtOsVersion , java.lang.String isoFile ) { boolean retValue = true ; if ( ovirtOsVersion != null ) { try { org.ovirt.engine.core.compat.RpmVersion isoVersion = new org.ovirt.engine.core.compat.RpmVersion ( isoFile , org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.OvirtIsoPrefix ) , true ) ; if ( ! ( org.ovirt.engine.core.bll.VdsHandler.isIsoVersionCompatibleForUpgrade ( ovirtOsVersion , isoVersion ) ) ) { retValue = false ; } } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.InstallVdsCommand.log.warnFormat ( "Failed to parse ISO file version {0} with error {1}" , isoFile , org.apache.commons.lang.exception.ExceptionUtils.getMessage ( e ) ) ; } } return retValue ; }

Target:
private void configureManagementNetwork ( ) { final org.ovirt.engine.core.bll.network.NetworkConfigurator networkConfigurator = new org.ovirt.engine.core.bll.network.NetworkConfigurator ( org.ovirt.engine.core.bll.InstallVdsCommand.getVds ( ) ) ; if ( ! ( networkConfigurator.awaitVdsmResponse ( ) ) ) { throw new org.ovirt.engine.core.bll.InstallVdsCommand.VdsInstallException ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonResponsive , "Network error during communication with the host" ) ; } try { networkConfigurator.refreshNetworkConfiguration ( ) ; networkConfigurator.createManagementNetworkIfRequired ( ) ; } catch ( org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException e ) { throw new org.ovirt.engine.core.bll.InstallVdsCommand.VdsInstallException ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonResponsive , "Network error during communication with the host" , e ) ; } catch ( java.lang.Exception e ) { throw new org.ovirt.engine.core.bll.InstallVdsCommand.VdsInstallException ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonOperational , "Failed to configure management network on the host" , e ) ; } }
Source:
private void doInit ( org.ovirt.engine.api.extensions.ExtMap inputMap , org.ovirt.engine.api.extensions.ExtMap outputMap ) { context = inputMap.< org.ovirt.engine.api.extensions.ExtMap > get ( Base.InvokeKeys.CONTEXT ) ; configuration = context.< java.util.Properties > get ( Base.ContextKeys.CONFIGURATION ) ; broker = org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapFactory.getInstance ( getAuthzName ( ) ) ; context.< java.util.List < java.lang.String > > get ( Base.ContextKeys.CONFIGURATION_SENSITIVE_KEYS ) . add ( "config.authn.user.password" ) ; context.mput ( Base.ContextKeys.AUTHOR , "The oVirt Project" ) . mput ( Base.ContextKeys.EXTENSION_NAME , "Kerberos/Ldap Authn (Built-in)" ) . mput ( Base.ContextKeys.LICENSE , "ASL 2.0" ) . mput ( Base.ContextKeys.HOME_URL , "http://www.ovirt.org" ) . mput ( Base.ContextKeys.VERSION , "N/A" ) . mput ( Authn.ContextKeys.CAPABILITIES , Authn.Capabilities.AUTHENTICATE_PASSWORD ) . mput ( Base.ContextKeys.BUILD_INTERFACE_VERSION , Base.INTERFACE_VERSION_CURRENT ) ; org.ovirt.engine.extensions.aaa.builtin.kerberosldap.KerberosManager.getInstance ( ) ; org.ovirt.engine.extensions.aaa.builtin.kerberosldap.UsersDomainsCacheManagerService.getInstance ( ) . init ( ) ; }

Target:
private void doInit ( org.ovirt.engine.api.extensions.ExtMap inputMap , org.ovirt.engine.api.extensions.ExtMap outputMap ) { org.ovirt.engine.extensions.aaa.builtin.kerberosldap.KerberosManager.getInstance ( ) ; org.ovirt.engine.extensions.aaa.builtin.kerberosldap.UsersDomainsCacheManagerService.getInstance ( ) . init ( ) ; }
Source:
public void testUpdate ( ) { org.ovirt.engine.core.common.scheduling.PolicyUnit policyUnitToUpdate = dao.get ( FixturesTool.POLICY_UNIT_MIGRATION ) ; java.util.Map < java.lang.String , java.lang.String > map = new java.util.LinkedHashMap < java.lang.String , java.lang.String > ( ) ; map.put ( "A" , "B" ) ; policyUnitToUpdate.setParameterRegExMap ( map ) ; dao.update ( policyUnitToUpdate ) ; org.ovirt.engine.core.common.scheduling.PolicyUnit result = dao.get ( policyUnitToUpdate.getId ( ) ) ; org.junit.Assert.assertTrue ( result.equals ( policyUnitToUpdate ) ) ; }

Target:
public void testUpdate ( ) { org.ovirt.engine.core.common.scheduling.PolicyUnit policyUnitToUpdate = dao.get ( FixturesTool.POLICY_UNIT_MIGRATION ) ; java.util.Map < java.lang.String , java.lang.String > map = new java.util.LinkedHashMap < java.lang.String , java.lang.String > ( ) ; map.put ( "A" , "B" ) ; policyUnitToUpdate.setParameterRegExMap ( map ) ; policyUnitToUpdate.setDescription ( "dummy description" ) ; dao.update ( policyUnitToUpdate ) ; org.ovirt.engine.core.common.scheduling.PolicyUnit result = dao.get ( policyUnitToUpdate.getId ( ) ) ; org.junit.Assert.assertTrue ( result.equals ( policyUnitToUpdate ) ) ; }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.core.bll.GetVmsRelatedToQuotaIdQuery.getDbFacade ( ) . getVmDao ( ) . getAllVmsRelatedToQuotaId ( org.ovirt.engine.core.bll.GetVmsRelatedToQuotaIdQuery.getParameters ( ) . getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { org.ovirt.engine.core.bll.VmHandler.updateDisksFromDb ( vm ) ; java.util.Collections.sort ( vm.getDiskList ( ) , new org.ovirt.engine.core.common.businessentities.comparators.DiskImageByDiskAliasComparator ( ) ) ; org.ovirt.engine.core.bll.ImagesHandler.fillImagesBySnapshots ( vm ) ; } org.ovirt.engine.core.bll.GetVmsRelatedToQuotaIdQuery.getQueryReturnValue ( ) . setReturnValue ( vms ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.core.bll.GetVmsRelatedToQuotaIdQuery.getDbFacade ( ) . getVmDao ( ) . getAllVmsRelatedToQuotaId ( org.ovirt.engine.core.bll.GetVmsRelatedToQuotaIdQuery.getParameters ( ) . getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { org.ovirt.engine.core.bll.VmHandler.updateDisksFromDb ( vm ) ; org.ovirt.engine.core.bll.VmHandler.updateVmInitFromDB ( vm.getStaticData ( ) , true ) ; java.util.Collections.sort ( vm.getDiskList ( ) , new org.ovirt.engine.core.common.businessentities.comparators.DiskImageByDiskAliasComparator ( ) ) ; org.ovirt.engine.core.bll.ImagesHandler.fillImagesBySnapshots ( vm ) ; } org.ovirt.engine.core.bll.GetVmsRelatedToQuotaIdQuery.getQueryReturnValue ( ) . setReturnValue ( vms ) ; }
Source:
protected void logExceptionAndCompensate ( java.lang.Exception e ) { log.errorFormat ( "Exception while wrapping-up compensation in endAction: {0}." , org.apache.commons.lang.exception.ExceptionUtils.getMessage ( e ) , e ) ; compensate ( ) ; }

Target:
private void internalEndWithFailure ( ) { log.error ( "Ending command '{}' with failure." , getClass ( ) . getName ( ) ) ; if ( hasTaskHandlers ( ) ) { if ( hasStepsToRevert ( ) ) { getCurrentTaskHandler ( ) . endWithFailure ( ) ; revertPreviousHandlers ( ) ; } else { getReturnValue ( ) . setEndActionTryAgain ( false ) ; } startPollingAsyncTasks ( ) ; } else { endWithFailure ( ) ; } rollbackQuota ( ) ; }
Source:
public void initVdsActionParametersForProvision ( org.ovirt.engine.core.compat.Guid pid , org.ovirt.engine.core.common.businessentities.ExternalHostGroup hg , org.ovirt.engine.core.common.businessentities.ExternalComputeResource cr , java.lang.String mac , java.lang.String discover_name ) { privateAddProvisioned = true ; hostMac = mac ; hostGroup = hg ; providerId = pid ; discoverName = discover_name ; computeResource = cr ; }

Target:
public void initVdsActionParametersForProvision ( org.ovirt.engine.core.compat.Guid pid , org.ovirt.engine.core.common.businessentities.ExternalHostGroup hg , org.ovirt.engine.core.common.businessentities.ExternalComputeResource cr , java.lang.String mac , java.lang.String discover_name , java.lang.String discover_ip ) { privateAddProvisioned = true ; hostMac = mac ; hostGroup = hg ; providerId = pid ; discoverName = discover_name ; computeResource = cr ; discoverIp = discover_ip ; }
Source:
public void testToString ( ) { junit.framework.Assert.assertEquals ( "1.0" , new org.ovirt.engine.core.compat.Version ( "1.0" ) . toString ( ) ) ; junit.framework.Assert.assertEquals ( "1.0" , new org.ovirt.engine.core.compat.Version ( "1.0" ) . toString ( ) ) ; junit.framework.Assert.assertEquals ( "1.2.3" , new org.ovirt.engine.core.compat.Version ( 1 , 2 , 3 ) . toString ( ) ) ; }

Target:
public void testToString ( ) { org.junit.Assert.assertEquals ( "1.0" , new org.ovirt.engine.core.compat.Version ( "1.0" ) . toString ( ) ) ; org.junit.Assert.assertEquals ( "1.0" , new org.ovirt.engine.core.compat.Version ( "1.0" ) . toString ( ) ) ; org.junit.Assert.assertEquals ( "1.2.3" , new org.ovirt.engine.core.compat.Version ( 1 , 2 , 3 ) . toString ( ) ) ; }
Source:
public void testValidateModifiedBondSlavesWhenSlaveIsNotValid ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = new org.ovirt.engine.core.common.businessentities.network.Bond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; doTestValidateModifiedBondSlaves ( bond , null , ValidationResult.VALID , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_INTERFACE_BOND_OR_VLAN_CANNOT_BE_SLAVE ) , false , VdcBllMessages.NETWORK_INTERFACE_BOND_OR_VLAN_CANNOT_BE_SLAVE ) ; }

Target:
public void testValidModifiedBondsWhenAllOk ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = new org.ovirt.engine.core.common.businessentities.network.Bond ( "bond1" ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; doTestValidModifiedBonds ( bond , ValidationResult.VALID , ValidationResult.VALID , ValidationResult.VALID , ValidationResult.VALID ) ; }
Source:
public static java.util.Set < java.lang.String > getDiskAliases ( java.util.List < ? extends org.ovirt.engine.core.common.businessentities.Disk > disks ) { java.util.Set < java.lang.String > aliases = new java.util.HashSet < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Disk disk : disks ) { aliases.add ( disk.getDiskAlias ( ) ) ; } return aliases ; }

Target:
public static java.util.Set < java.lang.String > getDiskAliases ( java.util.List < ? extends org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { java.util.Set < java.lang.String > aliases = new java.util.HashSet < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : disks ) { aliases.add ( disk.getDiskAlias ( ) ) ; } return aliases ; }
Source:
protected void updateMenuItem ( com.google.gwt.user.client.ui.MenuItem item , org.ovirt.engine.ui.common.widget.action.ActionButtonDefinition < T > buttonDef ) { item.setVisible ( ( ( buttonDef.isAccessible ( org.ovirt.engine.ui.common.widget.action.AbstractActionPanel.getSelectedItems ( ) ) ) && ( buttonDef.isVisible ( org.ovirt.engine.ui.common.widget.action.AbstractActionPanel.getSelectedItems ( ) ) ) ) ) ; item.setEnabled ( buttonDef.isEnabled ( org.ovirt.engine.ui.common.widget.action.AbstractActionPanel.getSelectedItems ( ) ) ) ; if ( ( buttonDef.getMenuItemTooltip ( ) ) != null ) { org.ovirt.engine.ui.common.widget.tooltip.TooltipMixin.addTooltipToElement ( buttonDef.getMenuItemTooltip ( ) , item.getElement ( ) ) ; } }

Target:
protected void updateMenuItem ( com.google.gwt.user.client.ui.MenuItem item , org.ovirt.engine.ui.common.widget.action.ActionButtonDefinition < T > buttonDef ) { item.setVisible ( ( ( buttonDef.isAccessible ( org.ovirt.engine.ui.common.widget.action.AbstractActionPanel.getSelectedItems ( ) ) ) && ( buttonDef.isVisible ( org.ovirt.engine.ui.common.widget.action.AbstractActionPanel.getSelectedItems ( ) ) ) ) ) ; item.setEnabled ( buttonDef.isEnabled ( org.ovirt.engine.ui.common.widget.action.AbstractActionPanel.getSelectedItems ( ) ) ) ; if ( ( buttonDef.getMenuItemTooltip ( ) ) != null ) { org.ovirt.engine.ui.common.widget.tooltip.ElementTooltipUtils.setTooltipOnElement ( buttonDef.getMenuItemTooltip ( ) , item.getElement ( ) ) ; } }
Source:
protected void bindCommonPresenters ( ) { bindSingletonPresenterWidget ( org.ovirt.engine.ui.common.presenter.popup.ErrorPopupPresenterWidget.class , ErrorPopupPresenterWidget.ViewDef.class , org.ovirt.engine.ui.common.view.popup.ErrorPopupView.class ) ; bindPresenterWidget ( org.ovirt.engine.ui.common.presenter.popup.DefaultConfirmationPopupPresenterWidget.class , DefaultConfirmationPopupPresenterWidget.ViewDef.class , org.ovirt.engine.ui.common.view.popup.DefaultConfirmationPopupView.class ) ; bindPresenterWidget ( org.ovirt.engine.ui.common.presenter.popup.RemoveConfirmationPopupPresenterWidget.class , RemoveConfirmationPopupPresenterWidget.ViewDef.class , org.ovirt.engine.ui.common.view.popup.RemoveConfirmationPopupView.class ) ; }

Target:
protected void bindCommonPresenters ( ) { bindSingletonPresenterWidget ( org.ovirt.engine.ui.common.presenter.popup.ErrorPopupPresenterWidget.class , ErrorPopupPresenterWidget.ViewDef.class , org.ovirt.engine.ui.common.view.popup.ErrorPopupView.class ) ; bindPresenterWidget ( org.ovirt.engine.ui.common.presenter.popup.DefaultConfirmationPopupPresenterWidget.class , DefaultConfirmationPopupPresenterWidget.ViewDef.class , org.ovirt.engine.ui.common.view.popup.DefaultConfirmationPopupView.class ) ; bindPresenterWidget ( org.ovirt.engine.ui.common.presenter.popup.RemoveConfirmationPopupPresenterWidget.class , RemoveConfirmationPopupPresenterWidget.ViewDef.class , org.ovirt.engine.ui.common.view.popup.RemoveConfirmationPopupView.class ) ; bindPresenterWidget ( org.ovirt.engine.ui.common.presenter.popup.ConsolePopupPresenterWidget.class , ConsolePopupPresenterWidget.ViewDef.class , org.ovirt.engine.ui.common.view.popup.ConsolePopupView.class ) ; }