auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void afterMigrationFrom ( org.ovirt.engine.core.common.businessentities.VmDynamic runningVm , org.ovirt.engine.core.common.businessentities.VM vmToUpdate ) { org.ovirt.engine.core.common.businessentities.VMStatus oldVmStatus = vmToUpdate.getStatus ( ) ; if ( ( oldVmStatus == ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) && ( org.ovirt.engine.core.common.businessentities.VM.isGuestUp ( runningVm.getstatus ( ) ) ) ) { _vmsToRerun.add ( runningVm.getId ( ) ) ; org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( "adding VM {0} to re-run list" , runningVm.getId ( ) ) ; vmToUpdate.setMigratingToVds ( null ) ; } }

Target:
private void afterMigrationFrom ( org.ovirt.engine.core.common.businessentities.VmDynamic runningVm , org.ovirt.engine.core.common.businessentities.VM vmToUpdate ) { org.ovirt.engine.core.common.businessentities.VMStatus oldVmStatus = vmToUpdate.getStatus ( ) ; org.ovirt.engine.core.common.businessentities.VMStatus currentVmStatus = runningVm.getstatus ( ) ; if ( ( ( oldVmStatus == ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) && ( currentVmStatus != ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) ) && ( currentVmStatus.isRunning ( ) ) ) { _vmsToRerun.add ( runningVm.getId ( ) ) ; org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( "Adding VM {0} to re-run list" , runningVm.getId ( ) ) ; vmToUpdate.setMigratingToVds ( null ) ; } }
Source:
private void validateEnumParameters ( org.ovirt.engine.api.model.GlusterVolume volume ) { validateEnum ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType.class , volume.getVolumeType ( ) ) ; if ( volume.isSetTransportTypes ( ) ) { validateEnums ( org.ovirt.engine.core.common.businessentities.gluster.TransportType.class , volume.getTransportTypes ( ) . getTransportTypes ( ) ) ; } if ( volume.isSetAccessProtocols ( ) ) { validateEnums ( org.ovirt.engine.core.common.businessentities.gluster.AccessProtocol.class , volume.getAccessProtocols ( ) . getAccessProtocols ( ) ) ; } }

Target:
private void validateEnumParameters ( org.ovirt.engine.api.model.GlusterVolume volume ) { validateEnum ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType.class , volume.getVolumeType ( ) . toUpperCase ( ) ) ; if ( volume.isSetTransportTypes ( ) ) { validateEnumValues ( org.ovirt.engine.core.common.businessentities.gluster.TransportType.class , org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResource.convertToUppercase ( volume.getTransportTypes ( ) . getTransportTypes ( ) ) ) ; } }
Source:
public int compare ( org.ovirt.engine.core.common.businessentities.network.Network o1 , org.ovirt.engine.core.common.businessentities.network.Network o2 ) { return HostInterfaceListModel.ENGINE_NETWORK_NAME.equals ( o1.getName ( ) ) ? - 1 : o1.getName ( ) . compareTo ( o2.getName ( ) ) ; }

Target:
public void OnSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.SearchableListModel searchableListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( model ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > newItems = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ; java.util.Collections.sort ( newItems , new org.ovirt.engine.ui.uicommonweb.Linq.NetworkComparator ( ) ) ; searchableListModel.setItems ( newItems ) ; }
Source:
private void setUpDAOMocks ( ) { snapshotDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.SnapshotDao.class ) ; org.mockito.Mockito.doReturn ( snapshotDaoMock ) . when ( getQuery ( ) ) . getSnapshotDao ( ) ; org.mockito.Mockito.when ( snapshotDaoMock.getAllWithConfiguration ( vmId ) ) . thenReturn ( java.util.Arrays.asList ( snapshot ) ) ; }

Target:
private void setUpDaoMocks ( ) { snapshotDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.SnapshotDao.class ) ; org.mockito.Mockito.doReturn ( snapshotDaoMock ) . when ( getQuery ( ) ) . getSnapshotDao ( ) ; org.mockito.Mockito.when ( snapshotDaoMock.getAllWithConfiguration ( vmId ) ) . thenReturn ( java.util.Arrays.asList ( snapshot ) ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.DiskImage getDiskImage ( ) { if ( ( diskImage ) == null ) { diskImage = getDiskImageDao ( ) . get ( org.ovirt.engine.core.bll.ExportRepoImageCommand.getParameters ( ) . getImageId ( ) ) ; } return diskImage ; }

Target:
protected org.ovirt.engine.core.common.businessentities.DiskImage getDiskImage ( ) { if ( ( diskImage ) == null ) { org.ovirt.engine.core.common.businessentities.Disk disk = getDiskDao ( ) . get ( org.ovirt.engine.core.bll.ExportRepoImageCommand.getParameters ( ) . getImageGroupID ( ) ) ; if ( ( disk != null ) && ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) ) { diskImage = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( disk ) ) ; } } return diskImage ; }
Source:
public void getGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }

Target:
public void getClustersHavingHosts ( 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 ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllClustersHavingHosts , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
private void SearchAdminRoles ( ) { setItemsFilter ( RoleType.ADMIN ) ; getSearchCommand ( ) . Execute ( ) ; }

Target:
public void onRemove ( ) { for ( java.lang.Object item : getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.Role role = ( ( org.ovirt.engine.core.common.businessentities.Role ) ( item ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.RemoveRole , new org.ovirt.engine.core.common.action.RolesParameterBase ( role.getId ( ) ) ) ; } cancel ( ) ; getSearchCommand ( ) . execute ( ) ; }
Source:
public java.lang.String renderNullSafe ( org.ovirt.engine.core.common.businessentities.Role object ) { return object.getName ( ) ; }

Target:
private void initListBoxEditors ( ) { profileSelection = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor < org.ovirt.engine.core.aaa.ProfileEntry > ( new org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer < org.ovirt.engine.core.aaa.ProfileEntry > ( ) { @ java.lang.Override public java.lang.String renderNullSafe ( org.ovirt.engine.core.aaa.ProfileEntry object ) { return object.toString ( ) ; } } ) ; roleSelection = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor ( new org.ovirt.engine.ui.common.widget.renderer.NameRenderer < org.ovirt.engine.core.common.businessentities.Role > ( ) ) ; namespaceSelection = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor < java.lang.String > ( new org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer < java.lang.String > ( ) { @ java.lang.Override protected java.lang.String renderNullSafe ( java.lang.String object ) { return object ; } } ) ; }
Source:
public void run ( ) { try { backend.runAction ( task , sp ) ; } finally { if ( ( user ) != null ) { backend.logoff ( sh.sessionize ( new org.ovirt.engine.core.common.action.LogoutUserParameters ( user.getId ( ) ) ) ) ; } sh.clean ( ) ; } }

Target:
public void run ( ) { try { backend.runAction ( task , sp ) ; } finally { if ( ( user ) != null ) { backend.logoff ( sh.sessionize ( new org.ovirt.engine.core.common.action.VdcActionParametersBase ( ) ) ) ; } sh.clean ( ) ; } }
Source:
protected void executeVdsIdCommand ( ) { if ( ( _vdsManager ) != null ) { org.ovirt.engine.core.vdsbroker.UpdateVdsVMsClearedVDSCommand.getVds ( ) . setVmCount ( 0 ) ; org.ovirt.engine.core.vdsbroker.UpdateVdsVMsClearedVDSCommand.getVds ( ) . setVmsCoresCount ( 0 ) ; org.ovirt.engine.core.vdsbroker.UpdateVdsVMsClearedVDSCommand.getVds ( ) . setVmActive ( 0 ) ; org.ovirt.engine.core.vdsbroker.UpdateVdsVMsClearedVDSCommand.getVds ( ) . setVmMigrating ( 0 ) ; _vdsManager.UpdateDynamicData ( org.ovirt.engine.core.vdsbroker.UpdateVdsVMsClearedVDSCommand.getVds ( ) . getDynamicData ( ) ) ; } else { org.ovirt.engine.core.vdsbroker.UpdateVdsVMsClearedVDSCommand.getVDSReturnValue ( ) . setSucceeded ( false ) ; } }

Target:
protected void executeVdsIdCommand ( ) { if ( ( _vdsManager ) != null ) { org.ovirt.engine.core.vdsbroker.UpdateVdsVMsClearedVDSCommand.getVds ( ) . setVmCount ( 0 ) ; org.ovirt.engine.core.vdsbroker.UpdateVdsVMsClearedVDSCommand.getVds ( ) . setVmsCoresCount ( 0 ) ; org.ovirt.engine.core.vdsbroker.UpdateVdsVMsClearedVDSCommand.getVds ( ) . setVmActive ( 0 ) ; org.ovirt.engine.core.vdsbroker.UpdateVdsVMsClearedVDSCommand.getVds ( ) . setVmMigrating ( 0 ) ; _vdsManager.updateDynamicData ( org.ovirt.engine.core.vdsbroker.UpdateVdsVMsClearedVDSCommand.getVds ( ) . getDynamicData ( ) ) ; } else { org.ovirt.engine.core.vdsbroker.UpdateVdsVMsClearedVDSCommand.getVDSReturnValue ( ) . setSucceeded ( false ) ; } }
Source:
public void testErrorHandling ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue value = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; value.setSucceeded ( false ) ; value.setExceptionObject ( new org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException ( "unknown host" ) ) ; org.mockito.Mockito.when ( updater.getVdsEventListener ( ) ) . thenReturn ( vdsEventlistener ) ; org.mockito.Mockito.when ( resourceManager.runVdsCommand ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.VDSCommandType.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.VDSParametersBase.class ) ) ) . thenReturn ( value ) ; updater.refreshVdsStats ( ) ; }

Target:
public void testErrorHandling ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue value = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; value.setSucceeded ( false ) ; value.setExceptionObject ( new org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException ( "unknown host" ) ) ; org.mockito.Mockito.when ( resourceManager.getEventListener ( ) ) . thenReturn ( vdsEventlistener ) ; org.mockito.Mockito.when ( resourceManager.runVdsCommand ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.VDSCommandType.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.VDSParametersBase.class ) ) ) . thenReturn ( value ) ; updater.refreshVdsStats ( ) ; }
Source:
public static void getGlusterRebalanceStatus ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid volumeId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity ) ( source ) ) ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeQueriesParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeQueriesParameters ( clusterId , volumeId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeRebalanceStatus , parameters , aQuery ) ; }

Target:
public static void getGlusterSwiftServerServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterServerServicesByClusterId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( clusterId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }
Source:
public void testAddIncompleteParameters2 ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Vm model = createModel ( null ) ; model.setTemplate ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Vm" , "add" , "template.id|name" ) ; } }

Target:
public void testAddIncompleteParameters2 ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Vm model = createModel ( null ) ; model.setTemplate ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; org.junit.Assert.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Vm" , "add" , "template.id|name" ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.HostDevice createFreeVf ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vnic , org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig hostNicVfsConfig ) { org.ovirt.engine.core.common.businessentities.HostDevice vf = createVf ( ) ; org.mockito.Mockito.when ( networkDeviceHelper.getFreeVf ( org.mockito.Matchers.eq ( getNic ( hostNicVfsConfig ) ) , org.mockito.Matchers.anyListOf ( java.lang.String.class ) ) ) . thenReturn ( vf ) ; return vf ; }

Target:
public boolean matches ( java.lang.Object argVf ) { return ( argVf == null ) || ( ! ( ( ( java.util.List < java.lang.String > ) ( argVf ) ) . contains ( vf.getName ( ) ) ) ) ; }
Source:
public void cpuTypeDoesNotSupportVirtServiceForVirtCluster ( ) { org.mockito.Mockito.when ( cluster.supportsVirtService ( ) ) . thenReturn ( true ) ; org.mockito.Mockito.doReturn ( false ) . when ( validator ) . cpuExists ( ) ; org.junit.Assert.assertThat ( validator.cpuTypeSupportsVirtService ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_CPU_NOT_FOUND ) ) ; }

Target:
public void cpuTypeDoesNotSupportVirtServiceForVirtCluster ( ) { org.mockito.Mockito.when ( cluster.supportsVirtService ( ) ) . thenReturn ( true ) ; org.mockito.Mockito.doReturn ( false ) . when ( validator ) . cpuExists ( ) ; org.hamcrest.MatcherAssert.assertThat ( validator.cpuTypeSupportsVirtService ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_CPU_NOT_FOUND ) ) ; }
Source:
public void networkRemovedFromBond ( ) { java.lang.String networkName = "net" ; org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond = createBond ( networkName ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > slaves = createBondSlaves ( bond.getName ( ) ) ; mockExistingIfacesWithBond ( bond , slaves ) ; bond.setNetworkName ( null ) ; org.ovirt.engine.core.common.action.SetupNetworksParameters parameters = createParametersForBond ( bond , slaves ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( parameters ) ; validateAndExpectNoViolations ( helper ) ; assertBondModified ( helper , bond ) ; assertNoNetworksModified ( helper ) ; assertNetworkRemoved ( helper , networkName ) ; assertNoBondsRemoved ( helper ) ; }

Target:
public void bondWithNetworkDidntChange ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.SetupNetworksHelperTest.BOND_NAME , "net" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ifaces = createNics ( bond.getName ( ) ) ; mockExistingIfacesWithBond ( bond , ifaces ) ; org.ovirt.engine.core.common.action.SetupNetworksParameters parameters = new org.ovirt.engine.core.common.action.SetupNetworksParameters ( ) ; ifaces.add ( bond ) ; parameters.setInterfaces ( ifaces ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( parameters ) ; validateAndExpectNoViolations ( helper ) ; assertNoBondsModified ( helper ) ; assertNoNetworksModified ( helper ) ; assertNoBondsRemoved ( helper ) ; assertNoNetworksRemoved ( helper ) ; }
Source:
public void correlationIdTooLong ( ) { org.ovirt.engine.core.common.action.ActionParametersBase parameters = new org.ovirt.engine.core.common.action.ActionParametersBase ( ) ; parameters.setCorrelationId ( org.apache.commons.lang.StringUtils.leftPad ( "" , ( ( org.ovirt.engine.core.common.businessentities.BusinessEntitiesDefinitions.CORRELATION_ID_SIZE ) + 1 ) , "A" ) ) ; org.ovirt.engine.core.common.action.ActionReturnValue result = org.ovirt.engine.core.bll.job.ExecutionHandler.evaluateCorrelationId ( parameters ) ; org.junit.Assert.assertNotNull ( "Correlation id exceeds max size" , result ) ; org.junit.Assert.assertFalse ( "Correlation id exceeds max size" , result.getSucceeded ( ) ) ; }

Target:
public void correlationIdTooLong ( ) { org.ovirt.engine.core.common.action.ActionParametersBase parameters = new org.ovirt.engine.core.common.action.ActionParametersBase ( ) ; parameters.setCorrelationId ( org.apache.commons.lang.StringUtils.leftPad ( "" , ( ( org.ovirt.engine.core.common.businessentities.BusinessEntitiesDefinitions.CORRELATION_ID_SIZE ) + 1 ) , "A" ) ) ; org.ovirt.engine.core.common.action.ActionReturnValue result = org.ovirt.engine.core.bll.job.ExecutionHandler.evaluateCorrelationId ( parameters ) ; org.junit.jupiter.api.Assertions.assertNotNull ( result , "Correlation id exceeds max size" ) ; org.junit.jupiter.api.Assertions.assertFalse ( result.getSucceeded ( ) , "Correlation id exceeds max size" ) ; }
Source:
protected void verify ( org.ovirt.engine.api.model.Disk model , org.ovirt.engine.api.model.Disk transform ) { org.junit.Assert.assertNotNull ( transform ) ; org.junit.Assert.assertEquals ( model.getId ( ) , transform.getId ( ) ) ; org.junit.Assert.assertEquals ( "unexpected propagate errors" , model.isPropagateErrors ( ) , transform.isPropagateErrors ( ) ) ; org.junit.Assert.assertEquals ( "unexpected wipe after delete" , model.isWipeAfterDelete ( ) , transform.isWipeAfterDelete ( ) ) ; org.junit.Assert.assertEquals ( "unexpected shareable" , model.isShareable ( ) , transform.isShareable ( ) ) ; }

Target:
protected void verify ( org.ovirt.engine.api.model.Disk model , org.ovirt.engine.api.model.Disk transform ) { org.junit.jupiter.api.Assertions.assertNotNull ( transform ) ; org.junit.jupiter.api.Assertions.assertEquals ( model.getId ( ) , transform.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( model.isPropagateErrors ( ) , transform.isPropagateErrors ( ) , "unexpected propagate errors" ) ; org.junit.jupiter.api.Assertions.assertEquals ( model.isWipeAfterDelete ( ) , transform.isWipeAfterDelete ( ) , "unexpected wipe after delete" ) ; org.junit.jupiter.api.Assertions.assertEquals ( model.isShareable ( ) , transform.isShareable ( ) , "unexpected shareable" ) ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( true ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetDomainExpectations ( StorageType.NFS , false ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
private void initImportClonedTemplate ( ) { getParameters ( ) . getVmTemplate ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : getParameters ( ) . getVmTemplate ( ) . getInterfaces ( ) ) { iface.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; } }

Target:
private void initImportClonedTemplate ( ) { org.ovirt.engine.core.compat.Guid newTemplateId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; getParameters ( ) . getVmTemplate ( ) . setId ( newTemplateId ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : getParameters ( ) . getVmTemplate ( ) . getInterfaces ( ) ) { iface.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; } getParameters ( ) . getVmTemplate ( ) . setBaseTemplateId ( newTemplateId ) ; }
Source:
protected org.springframework.jdbc.core.namedparam.MapSqlParameterSource createFullParametersMapper ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource mapper = createIdParameterMapper ( networkAttachment.getId ( ) ) . addValue ( "network_id" , networkAttachment.getNetworkId ( ) ) . addValue ( "nic_id" , networkAttachment.getNicId ( ) ) . addValue ( "custom_properties" , org.ovirt.engine.core.utils.SerializationFactory.getSerializer ( ) . serialize ( networkAttachment.getProperties ( ) ) ) ; org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = networkAttachment.getIpConfiguration ( ) ; mapIpConfiguration ( mapper , ( ipConfiguration == null ? new org.ovirt.engine.core.common.businessentities.network.IpConfiguration ( ) : ipConfiguration ) ) ; return mapper ; }

Target:
private void mapIpConfiguration ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment , org.springframework.jdbc.core.namedparam.MapSqlParameterSource mapper ) { final org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = ( ( networkAttachment.getIpConfiguration ( ) ) == null ) ? new org.ovirt.engine.core.common.businessentities.network.IpConfiguration ( ) : networkAttachment.getIpConfiguration ( ) ; mapIpv4Configuration ( mapper , ipConfiguration ) ; mapIpv6Configuration ( mapper , ipConfiguration ) ; }
Source:
public static < T > T injectMembers ( T instance ) { javax.enterprise.inject.spi.AnnotatedType type = org.ovirt.engine.core.di.Injector.injector.manager.createAnnotatedType ( instance.getClass ( ) ) ; javax.enterprise.inject.spi.InjectionTarget injectionTarget = org.ovirt.engine.core.di.Injector.injector.manager.createInjectionTarget ( type ) ; injectionTarget.inject ( instance , org.ovirt.engine.core.di.Injector.injector.manager.createCreationalContext ( null ) ) ; injectionTarget.postConstruct ( instance ) ; return instance ; }

Target:
public static < T > T injectMembers ( T instance ) { javax.enterprise.inject.spi.AnnotatedType type = javax.enterprise.inject.spi.CDI.current ( ) . getBeanManager ( ) . createAnnotatedType ( instance.getClass ( ) ) ; javax.enterprise.inject.spi.InjectionTarget injectionTarget = javax.enterprise.inject.spi.CDI.current ( ) . getBeanManager ( ) . createInjectionTarget ( type ) ; injectionTarget.inject ( instance , javax.enterprise.inject.spi.CDI.current ( ) . getBeanManager ( ) . createCreationalContext ( null ) ) ; injectionTarget.postConstruct ( instance ) ; return instance ; }
Source:
public void onScroll ( com.google.gwt.event.dom.client.ScrollEvent event ) { int currentScrollPosition = scrollPanel.getVerticalScrollPosition ( ) ; int maxScrollPosition = scrollPanel.getMaximumVerticalScrollPosition ( ) ; if ( currentScrollPosition >= maxScrollPosition ) { int pageSize = getDataDisplayWidget ( ) . getPageSize ( ) ; com.google.gwt.view.client.Range visibleRange = getDataDisplayWidget ( ) . getVisibleRange ( ) ; getDataDisplayWidget ( ) . setVisibleRange ( visibleRange.getStart ( ) , ( ( visibleRange.getLength ( ) ) + pageSize ) ) ; } }

Target:
private void setProperVisibleRange ( ) { com.google.gwt.view.client.Range visibleRange = getDataDisplayWidget ( ) . getVisibleRange ( ) ; getDataDisplayWidget ( ) . setVisibleRange ( visibleRange.getStart ( ) , ( ( visibleRange.getLength ( ) ) + ( getDataDisplayWidget ( ) . getPageSize ( ) ) ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getStoragePoolDao ( ) ; existingPool = dao.get ( FixturesTool.DATA_CENTER ) ; existingPool.setStatus ( StoragePoolStatus.Up ) ; vds = new org.ovirt.engine.core.compat.Guid ( "afce7a39-8e8c-4819-ba9c-796d316592e6" ) ; cluster = new org.ovirt.engine.core.compat.Guid ( "b399944a-81ab-4ec5-8266-e19ba7c3c9d1" ) ; storageDomain = new org.ovirt.engine.core.compat.Guid ( "72e3a666-89e1-4005-a7ca-f7548004a9ab" ) ; newPool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; newPool.setName ( "newPoolDude" ) ; newPool.setCompatibilityVersion ( org.ovirt.engine.core.compat.Version.getLast ( ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getStoragePoolDao ( ) ; existingPool = dao.get ( FixturesTool.DATA_CENTER ) ; existingPool.setStatus ( StoragePoolStatus.Up ) ; vds = FixturesTool.VDS_RHEL6_NFS_SPM ; cluster = new org.ovirt.engine.core.compat.Guid ( "b399944a-81ab-4ec5-8266-e19ba7c3c9d1" ) ; storageDomain = new org.ovirt.engine.core.compat.Guid ( "72e3a666-89e1-4005-a7ca-f7548004a9ab" ) ; newPool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; newPool.setName ( "newPoolDude" ) ; newPool.setCompatibilityVersion ( org.ovirt.engine.core.compat.Version.getLast ( ) ) ; }
Source:
private org.ovirt.engine.api.model.Networks mapCollection ( java.util.List < org.ovirt.engine.api.model.Network > entities ) { org.ovirt.engine.api.model.Networks collection = new org.ovirt.engine.api.model.Networks ( ) ; for ( org.ovirt.engine.api.model.Network entity : entities ) { collection.getNetworks ( ) . add ( addLinks ( map ( entity ) ) ) ; } return collection ; }

Target:
public org.ovirt.engine.api.model.Networks list ( ) { org.ovirt.engine.api.model.Networks networks = mapCollection ( getNetworks ( ) ) ; for ( org.ovirt.engine.api.model.Network network : networks.getNetworks ( ) ) { network.setDisplay ( null ) ; } return networks ; }
Source:
public void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , 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 ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }

Target:
public void getHostListByDataCenter ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid spId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVdsByStoragePool , new org.ovirt.engine.core.common.queries.IdQueryParameters ( spId ) , aQuery ) ; }
Source:
public javax.ws.rs.core.Response toResponse ( org.ovirt.engine.api.restapi.utils.MappingException exception ) { org.ovirt.engine.api.restapi.resource.validation.MappingExceptionMapper.log.error ( "Exception" , exception ) ; final org.ovirt.engine.api.model.Fault fault = new org.ovirt.engine.api.model.Fault ( ) ; fault.setReason ( "Operation Failed" ) ; return javax.ws.rs.core.Response.status ( Response.Status.INTERNAL_SERVER_ERROR ) . entity ( fault ) . build ( ) ; }

Target:
public javax.ws.rs.core.Response toResponse ( org.ovirt.engine.api.restapi.utils.MappingException exception ) { org.ovirt.engine.api.restapi.resource.validation.MappingExceptionMapper.log.error ( "Mapping exception while processing \"{}\" request for path \"{}\"" , request.getMethod ( ) , uriInfo.getPath ( ) ) ; org.ovirt.engine.api.restapi.resource.validation.MappingExceptionMapper.log.error ( "Exception" , exception ) ; final org.ovirt.engine.api.model.Fault fault = new org.ovirt.engine.api.model.Fault ( ) ; fault.setReason ( "Operation Failed" ) ; return javax.ws.rs.core.Response.status ( Response.Status.INTERNAL_SERVER_ERROR ) . entity ( fault ) . build ( ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc createVG ( java.lang.String sdUUID , java.lang.String [ ] deviceList ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "LVMVolumeGroup.create" ) . withParameter ( "name" , sdUUID ) . withParameter ( "devlist" , new java.util.ArrayList < java.lang.String > ( java.util.Arrays.asList ( deviceList ) ) ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "uuid" ) ; return new org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc allocateVolume ( java.lang.String spUUID , java.lang.String sdUUID , java.lang.String imgGUID , java.lang.String volUUID , java.lang.String size ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Volume.allocate" ) . withParameter ( "volumeID" , volUUID ) . withParameter ( "storagepoolID" , spUUID ) . withParameter ( "storagedomainID" , sdUUID ) . withParameter ( "imageID" , imgGUID ) . withParameter ( "size" , size ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "uuid" ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }
Source:
protected boolean checkOperationIsCorrect ( ) { if ( ( ( ( org.ovirt.engine.core.bll.storage.disk.MoveOrCopyDiskCommand.getParameters ( ) . getOperation ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.ImageOperation.Move ) ) && ( ( getImage ( ) . getVmEntityType ( ) ) != null ) ) && ( getImage ( ) . getVmEntityType ( ) . isTemplateType ( ) ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_DISK_IS_NOT_VM_DISK ) ; } return true ; }

Target:
protected boolean checkOperationIsCorrect ( ) { if ( ( ( ( org.ovirt.engine.core.bll.storage.disk.MoveOrCopyDiskCommand.getParameters ( ) . getOperation ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.ImageOperation.Move ) ) && ( ( getImage ( ) . getVmEntityType ( ) ) != null ) ) && ( getImage ( ) . getVmEntityType ( ) . isTemplateType ( ) ) ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_DISK_IS_NOT_VM_DISK ) ; } return true ; }
Source:
public static void getGlusterHooks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }

Target:
public void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }
Source:
protected void RemoveNetwork ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > list = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkInterfaceDao ( ) . getAllForTemplate ( org.ovirt.engine.core.bll.VmTemplateCommand.getVmTemplateId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : list ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( iface.getId ( ) , org.ovirt.engine.core.bll.VmTemplateCommand.getVmTemplateId ( ) ) ) ; org.ovirt.engine.core.bll.VmTemplateCommand.getVmNicDao ( ) . remove ( iface.getId ( ) ) ; } }

Target:
protected void RemoveNetwork ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNic > list = org.ovirt.engine.core.bll.VmTemplateCommand.getVmNicDao ( ) . getAllForTemplate ( org.ovirt.engine.core.bll.VmTemplateCommand.getVmTemplateId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNic iface : list ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( iface.getId ( ) , org.ovirt.engine.core.bll.VmTemplateCommand.getVmTemplateId ( ) ) ) ; org.ovirt.engine.core.bll.VmTemplateCommand.getVmNicDao ( ) . remove ( iface.getId ( ) ) ; } }
Source:
public static org.ovirt.engine.ui.uicommonweb.models.Model createUpgradeModel ( final org.ovirt.engine.core.common.businessentities.VDS host ) { org.ovirt.engine.ui.uicommonweb.models.Model model ; if ( ( host.getVdsType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSType.oVirtNode ) ) { model = new org.ovirt.engine.ui.uicommonweb.models.hosts.UpgradeModel ( host ) ; } else { model = new org.ovirt.engine.ui.uicommonweb.models.hosts.UpgradeConfirmationModel ( host ) ; } return model ; }

Target:
public static org.ovirt.engine.ui.uicommonweb.models.Model createUpgradeModel ( final org.ovirt.engine.core.common.businessentities.VDS host ) { org.ovirt.engine.ui.uicommonweb.models.Model model ; if ( host.isOvirtNode ( ) ) { model = new org.ovirt.engine.ui.uicommonweb.models.hosts.UpgradeModel ( host ) ; } else { model = new org.ovirt.engine.ui.uicommonweb.models.hosts.UpgradeConfirmationModel ( host ) ; } return model ; }
Source:
private org.ovirt.engine.core.common.businessentities.AsyncTasks createAsyncTask ( org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parentParameters = getParentParameters ( parentCommand ) ; return new org.ovirt.engine.core.common.businessentities.AsyncTasks ( parentCommand , org.ovirt.engine.core.common.businessentities.AsyncTaskResultEnum.success , org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum.running , asyncTaskCreationInfo.getVdsmTaskId ( ) , parentParameters , getParameters ( ) , asyncTaskCreationInfo.getStepId ( ) , getCommandId ( ) , parentParameters.getCommandId ( ) , asyncTaskCreationInfo.getStoragePoolID ( ) , asyncTaskCreationInfo.getTaskType ( ) ) ; }

Target:
protected void removeCommand ( ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.removeCommand ( getCommandId ( ) ) ; } finally { if ( transaction != null ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } } }
Source:
public static org.ovirt.engine.core.common.businessentities.ActionGroup map ( org.ovirt.engine.api.model.Permit model , org.ovirt.engine.core.common.businessentities.ActionGroup template ) { assert ( model.isSetId ( ) ) || ( model.isSetName ( ) ) ; return template != null ? template : ( model.getId ( ) ) != null ? org.ovirt.engine.core.common.businessentities.ActionGroup.forValue ( java.lang.Integer.valueOf ( model.getId ( ) ) ) : org.ovirt.engine.core.common.businessentities.ActionGroup.valueOf ( model.getName ( ) . toUpperCase ( ) ) ; }

Target:
public static org.ovirt.engine.core.common.businessentities.ActionGroup map ( org.ovirt.engine.api.model.Permit model , org.ovirt.engine.core.common.businessentities.ActionGroup template ) { assert ( model.isSetId ( ) ) || ( model.isSetName ( ) ) ; return template != null ? template : ( model.getId ( ) ) != null ? org.ovirt.engine.core.common.businessentities.ActionGroup.forValue ( java.lang.Integer.parseInt ( model.getId ( ) ) ) : org.ovirt.engine.core.common.businessentities.ActionGroup.valueOf ( model.getName ( ) . toUpperCase ( ) ) ; }
Source:
public void logNetworkException ( org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException e ) { switch ( vds.getStatus ( ) ) { case Down : break ; case NonResponsive : org.ovirt.engine.core.vdsbroker.VdsManager.log.debugFormat ( "Failed to refresh VDS , vds = {0} : {1}, VDS Network Error, continuing.\n{2}" , vds.getId ( ) , vds.getName ( ) , e.getMessage ( ) ) ; break ; default : org.ovirt.engine.core.vdsbroker.VdsManager.log.warnFormat ( "Failed to refresh VDS , vds = {0} : {1}, VDS Network Error, continuing.\n{2}" , vds.getId ( ) , vds.getName ( ) , e.getMessage ( ) ) ; } }

Target:
private void logNetworkException ( org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException e ) { switch ( vds.getStatus ( ) ) { case Down : break ; case NonResponsive : org.ovirt.engine.core.vdsbroker.VdsManager.log.debug ( "Failed to refresh VDS, network error, continuing, vds='{}'({}): {}" , vds.getName ( ) , vds.getId ( ) , e.getMessage ( ) ) ; break ; default : org.ovirt.engine.core.vdsbroker.VdsManager.log.warn ( "Failed to refresh VDS, network error, continuing, vds='{}'({}): {}" , vds.getName ( ) , vds.getId ( ) , e.getMessage ( ) ) ; } org.ovirt.engine.core.vdsbroker.VdsManager.log.debug ( "Exception" , e ) ; }
Source:
protected javax.ws.rs.core.UriInfo setUpChangeCdUriQueryExpectations ( ) { javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; javax.ws.rs.core.MultivaluedMap < java.lang.String , java.lang.String > queries = control.createMock ( javax.ws.rs.core.MultivaluedMap.class ) ; org.easymock.EasyMock.expect ( queries.getFirst ( "current" ) ) . andReturn ( "true" ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( uriInfo.getQueryParameters ( ) ) . andReturn ( queries ) . anyTimes ( ) ; return uriInfo ; }

Target:
protected javax.ws.rs.core.UriInfo setUpChangeCdUriQueryExpectations ( ) { javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; javax.ws.rs.core.MultivaluedMap < java.lang.String , java.lang.String > queries = control.createMock ( javax.ws.rs.core.MultivaluedMap.class ) ; org.easymock.EasyMock.expect ( queries.containsKey ( "current" ) ) . andReturn ( true ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( queries.getFirst ( "current" ) ) . andReturn ( "true" ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( uriInfo.getQueryParameters ( ) ) . andReturn ( queries ) . anyTimes ( ) ; return uriInfo ; }
Source:
public void testAttachSuccess ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpActionExpectations ( ActionType.AttachStorageConnectionToStorageDomain , org.ovirt.engine.core.common.action.AttachDetachStorageConnectionParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ; org.ovirt.engine.api.model.StorageConnection connection = new org.ovirt.engine.api.model.StorageConnection ( ) ; connection.setId ( GUIDS [ 3 ] . toString ( ) ) ; javax.ws.rs.core.Response response = collection.add ( connection ) ; org.junit.Assert.assertEquals ( 200 , response.getStatus ( ) ) ; }

Target:
public void testAttachSuccess ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpActionExpectations ( ActionType.AttachStorageConnectionToStorageDomain , org.ovirt.engine.core.common.action.AttachDetachStorageConnectionParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ; org.ovirt.engine.api.model.StorageConnection connection = new org.ovirt.engine.api.model.StorageConnection ( ) ; connection.setId ( GUIDS [ 3 ] . toString ( ) ) ; javax.ws.rs.core.Response response = collection.add ( connection ) ; org.junit.jupiter.api.Assertions.assertEquals ( 200 , response.getStatus ( ) ) ; }
Source:
public void onFailure ( final java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute RunQuery: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.getEventsHandler ( ) . runQueryFailed ( null ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; if ( callback.isHandleFailure ( ) ) { org.ovirt.engine.ui.frontend.Frontend.setLoggedInUser ( null ) ; org.ovirt.engine.ui.frontend.Frontend.setLoginPassword ( null ) ; callback.asyncCallback.onSuccess ( callback.getModel ( ) , null ) ; } }

Target:
public void onFailure ( final java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute RunQuery: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.getEventsHandler ( ) . runQueryFailed ( null ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; if ( callback.isHandleFailure ( ) ) { org.ovirt.engine.ui.frontend.Frontend.clearLoggedInUser ( ) ; callback.getDel ( ) . onSuccess ( callback.getModel ( ) , null ) ; } }
Source:
public void testDebugFaultDetail ( ) throws java.lang.Exception { setUpLogExpectations ( true ) ; java.lang.Throwable t = new java.lang.Exception ( "snafu" ) ; java.lang.String detail = org.ovirt.engine.api.restapi.resource.AbstractBackendResource.detail ( t ) ; java.io.StringWriter sw = new java.io.StringWriter ( ) ; t.printStackTrace ( new java.io.PrintWriter ( sw , true ) ) ; org.junit.Assert.assertEquals ( sw.toString ( ) , detail ) ; }

Target:
public void testDebugFaultDetail ( ) throws java.lang.Exception { setUpLogExpectations ( true ) ; java.lang.Throwable t = new java.lang.Exception ( "snafu" ) ; java.lang.String detail = org.ovirt.engine.api.restapi.resource.AbstractBackendResource.detail ( t ) ; java.io.StringWriter sw = new java.io.StringWriter ( ) ; t.printStackTrace ( new java.io.PrintWriter ( sw , true ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( sw.toString ( ) , detail ) ; }
Source:
public void Connected ( ) { if ( ( _currentInstallStage ) == ( VdsInstallStages.ConnectToServer ) ) { org.ovirt.engine.core.bll.VdsInstaller.log.infoFormat ( "Installation of {0}. Successfully connected to server ssh. (Stage: {1})" , _serverName , getCurrentInstallStage ( ) ) ; _currentInstallStage = org.ovirt.engine.core.bll.VdsInstallStages.forValue ( ( ( _currentInstallStage.getValue ( ) ) + 1 ) ) ; _executionSucceded = true ; } else if ( ( _currentInstallStage ) != ( VdsInstallStages.Error ) ) { org.ovirt.engine.core.bll.VdsInstaller.log.warnFormat ( "Installation of {0}. Illegal stage to connect to Host. (Stage: {1})" , _serverName , getCurrentInstallStage ( ) ) ; _currentInstallStage = VdsInstallStages.Error ; } }

Target:
public void connected ( ) { if ( ( _currentInstallStage ) == ( VdsInstallStages.ConnectToServer ) ) { org.ovirt.engine.core.bll.VdsInstaller.log.infoFormat ( "Installation of {0}. Successfully connected to server ssh. (Stage: {1})" , _serverName , getCurrentInstallStage ( ) ) ; _currentInstallStage = org.ovirt.engine.core.bll.VdsInstallStages.forValue ( ( ( _currentInstallStage.getValue ( ) ) + 1 ) ) ; _executionSucceded = true ; } else if ( ( _currentInstallStage ) != ( VdsInstallStages.Error ) ) { org.ovirt.engine.core.bll.VdsInstaller.log.warnFormat ( "Installation of {0}. Illegal stage to connect to Host. (Stage: {1})" , _serverName , getCurrentInstallStage ( ) ) ; _currentInstallStage = VdsInstallStages.Error ; } }
Source:
private static java.lang.Double truncatePercentage ( java.lang.Double value ) { return value == null ? null : java.lang.Math.min ( 100 , value ) ; }

Target:
private static org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface resolveActiveNic ( org.ovirt.engine.core.common.businessentities.VDS host , java.lang.String hostIp ) { if ( hostIp == null ) { return null ; } final java.lang.String managementAddress = hostIp ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface activeIface = org.ovirt.engine.core.utils.linq.LinqUtils.firstOrNull ( host.getInterfaces ( ) , new org.ovirt.engine.core.utils.network.predicate.InterfaceByAddressPredicate ( managementAddress ) ) ; return activeIface ; }
Source:
protected void setActionMessageParameters ( ) { addCanDoActionMessage ( EngineMessage.VAR__ACTION__MIGRATE ) ; addCanDoActionMessage ( EngineMessage.VAR__TYPE__VM ) ; }

Target:
private java.lang.String findValidMigrationIpAddress ( org.ovirt.engine.core.common.businessentities.network.Network migrationNetwork , java.util.function.Function < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface , java.lang.String > ipAddressGetter ) { final java.lang.String migrationSourceIpAddress = getMigrationNetworkAddress ( org.ovirt.engine.core.bll.MigrateVmCommand.getVds ( ) . getId ( ) , migrationNetwork.getName ( ) , ipAddressGetter ) ; if ( org.apache.commons.lang.StringUtils.isNotEmpty ( migrationSourceIpAddress ) ) { final java.lang.String migrationDestinationIpAddress = getMigrationNetworkAddress ( getDestinationVds ( ) . getId ( ) , migrationNetwork.getName ( ) , ipAddressGetter ) ; if ( org.apache.commons.lang.StringUtils.isNotEmpty ( migrationDestinationIpAddress ) ) { return migrationDestinationIpAddress ; } } return null ; }