auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void onUpload ( ) { flush ( ) ; if ( ( ( getProgress ( ) ) != null ) || ( ! ( validate ( true ) ) ) ) { return ; } if ( ! ( isResumeUpload ) ) { initiateNewUpload ( ) ; } else { initiateResumeUpload ( ) ; } }

Target:
public void onUpload ( ) { if ( flush ( ) ) { if ( ( getProgress ( ) ) != null ) { return ; } if ( ! ( isResumeUpload ) ) { initiateNewUpload ( ) ; } else { initiateResumeUpload ( ) ; } } }
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:
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 ; }
Source:
public void testDoFilterFromRequest ( ) throws java.io.IOException , javax.servlet.ServletException { org.mockito.Mockito.when ( mockRequest.getLocale ( ) ) . thenReturn ( java.util.Locale.JAPANESE ) ; testFilter.doFilter ( mockRequest , mockResponse , mockChain ) ; org.mockito.Mockito.verify ( mockChain ) . doFilter ( mockRequest , mockResponse ) ; org.mockito.Mockito.verify ( mockResponse , org.mockito.Mockito.times ( 1 ) ) . addCookie ( ( ( javax.servlet.http.Cookie ) ( org.mockito.Mockito.any ( ) ) ) ) ; org.mockito.Mockito.verify ( mockRequest ) . setAttribute ( LocaleFilter.LOCALE , java.util.Locale.JAPAN ) ; }

Target:
public void testDoFilterFromRequest ( ) throws java.io.IOException , javax.servlet.ServletException { org.mockito.Mockito.when ( mockRequest.getLocale ( ) ) . thenReturn ( java.util.Locale.JAPANESE ) ; testFilter.doFilter ( mockRequest , mockResponse , mockChain ) ; org.mockito.Mockito.verify ( mockChain ) . doFilter ( mockRequest , mockResponse ) ; org.mockito.Mockito.verify ( mockResponse , org.mockito.Mockito.times ( 1 ) ) . addCookie ( org.mockito.Mockito.any ( ) ) ; org.mockito.Mockito.verify ( mockRequest ) . setAttribute ( LocaleFilter.LOCALE , java.util.Locale.JAPAN ) ; }
Source:
protected void endWithFailure ( ) { setVm ( null ) ; if ( ( getVm ( ) ) != null ) { endActionOnAllImageGroups ( ) ; removeVmNetworkInterfaces ( ) ; removeVmSnapshots ( getVm ( ) ) ; getVmDynamicDAO ( ) . remove ( getVmId ( ) ) ; getVmStatisticsDAO ( ) . remove ( getVmId ( ) ) ; getVmStaticDAO ( ) . remove ( getVmId ( ) ) ; setSucceeded ( true ) ; } else { setVm ( getParameters ( ) . getVm ( ) ) ; getReturnValue ( ) . setEndActionTryAgain ( false ) ; } }

Target:
protected void endWithFailure ( ) { setVm ( null ) ; if ( ( getVm ( ) ) != null ) { removeVmSnapshots ( getVm ( ) ) ; endActionOnAllImageGroups ( ) ; removeVmNetworkInterfaces ( ) ; getVmDynamicDAO ( ) . remove ( getVmId ( ) ) ; getVmStatisticsDAO ( ) . remove ( getVmId ( ) ) ; getVmStaticDAO ( ) . remove ( getVmId ( ) ) ; setSucceeded ( true ) ; } else { setVm ( getParameters ( ) . getVm ( ) ) ; getReturnValue ( ) . setEndActionTryAgain ( false ) ; } }
Source:
protected void getDowntime ( ) { if ( org.ovirt.engine.core.common.FeatureSupported.migrateDowntime ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getVdsGroupCompatibilityVersion ( ) ) ) { try { org.ovirt.engine.core.common.vdscommands.VDSReturnValue retVal = runVdsCommand ( VDSCommandType.MigrateStatus , new org.ovirt.engine.core.common.vdscommands.MigrateStatusVDSCommandParameters ( getDestinationVdsId ( ) , org.ovirt.engine.core.bll.MigrateVmCommand.getVmId ( ) ) ) ; if ( retVal != null ) { actualDowntime = ( ( java.lang.Integer ) ( retVal.getReturnValue ( ) ) ) ; } } catch ( org.ovirt.engine.core.common.errors.EngineException e ) { migrationErrorCode = e.getErrorCode ( ) ; } } }

Target:
protected void getDowntime ( ) { try { org.ovirt.engine.core.common.vdscommands.VDSReturnValue retVal = runVdsCommand ( VDSCommandType.MigrateStatus , new org.ovirt.engine.core.common.vdscommands.MigrateStatusVDSCommandParameters ( getDestinationVdsId ( ) , org.ovirt.engine.core.bll.MigrateVmCommand.getVmId ( ) ) ) ; if ( retVal != null ) { actualDowntime = ( ( java.lang.Integer ) ( retVal.getReturnValue ( ) ) ) ; } } catch ( org.ovirt.engine.core.common.errors.EngineException e ) { migrationErrorCode = e.getErrorCode ( ) ; } }
Source:
public void testRemoveForcedIncomplete ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( ) ; setUpGetPayloadExpectations ( 0 ) ; setUpGetBallooningExpectations ( ) ; setUpActionExpectations ( VdcActionType.RemoveVm , org.ovirt.engine.core.common.action.RemoveVmParameters.class , new java.lang.String [ ] { "VmId" , "Force" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.FALSE } , true , true ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) , new org.ovirt.engine.api.model.Action ( ) { { } } ) ) ; }

Target:
public void testRemoveForcedIncomplete ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( ) ; setUpGetPayloadExpectations ( 1 , 0 ) ; setUpGetBallooningExpectations ( 1 ) ; setUpActionExpectations ( VdcActionType.RemoveVm , org.ovirt.engine.core.common.action.RemoveVmParameters.class , new java.lang.String [ ] { "VmId" , "Force" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.FALSE } , true , true ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) , new org.ovirt.engine.api.model.Action ( ) { { } } ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isGlusterDcAndMatchingCompatiblityVersion ( ) { if ( ( ( storagePool.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.GLUSTERFS ) ) && ( ! ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.GlusterFsStorageEnabled , storagePool.getcompatibility_version ( ) . toString ( ) ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.DATA_CENTER_GLUSTER_STORAGE_NOT_SUPPORTED_IN_CURRENT_VERSION ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isGlusterDcAndMatchingCompatiblityVersion ( ) { if ( ( ( storagePool.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.GLUSTERFS ) ) && ( ! ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.GlusterFsStorageEnabled , storagePool.getcompatibility_version ( ) . toString ( ) ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.DATA_CENTER_GLUSTER_STORAGE_NOT_SUPPORTED_IN_CURRENT_VERSION ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.Network model = org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }

Target:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; org.ovirt.engine.api.model.Network model = org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }
Source:
private java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.DiskImage > getTemplateDisks ( org.ovirt.engine.core.compat.Guid templateId ) { java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.DiskImage > templatesDisksMap = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage di : ( ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( getEntity ( java.util.List.class , VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.GetVmTemplatesDisksParameters ( templateId ) , "Disks" ) ) ) ) { templatesDisksMap.put ( di.getId ( ) , di ) ; } return templatesDisksMap ; }

Target:
private java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.DiskImage > getTemplateDisks ( org.ovirt.engine.core.compat.Guid templateId ) { java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.DiskImage > templatesDisksMap = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage di : ( ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( getEntity ( java.util.List.class , VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , "Disks" ) ) ) ) { templatesDisksMap.put ( di.getId ( ) , di ) ; } return templatesDisksMap ; }
Source:
public void run ( ) { try { org.ovirt.engine.core.common.action.VdcReturnValueBase ret = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.ApproveVds , params ) ; if ( ( ret == null ) || ( ! ( ret.getSucceeded ( ) ) ) ) { org.ovirt.engine.core.bll.RegisterVdsQuery.log.errorFormat ( "Approval of oVirt {0} failed. " , params.getVdsId ( ) ) ; } else if ( ret.getSucceeded ( ) ) { org.ovirt.engine.core.bll.RegisterVdsQuery.log.infoFormat ( "Approval of oVirt {0} ended successefully. " , params.getVdsId ( ) ) ; } } catch ( java.lang.RuntimeException ex ) { org.ovirt.engine.core.bll.RegisterVdsQuery.log.error ( "Failed to Approve host" , ex ) ; } }

Target:
public void run ( ) { try { org.ovirt.engine.core.common.action.VdcReturnValueBase ret = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.ApproveVds , params ) ; if ( ( ret == null ) || ( ! ( ret.getSucceeded ( ) ) ) ) { log.errorFormat ( "Approval of oVirt {0} failed. " , params.getVdsId ( ) ) ; } else if ( ret.getSucceeded ( ) ) { log.infoFormat ( "Approval of oVirt {0} ended successefully. " , params.getVdsId ( ) ) ; } } catch ( java.lang.RuntimeException ex ) { log.error ( "Failed to Approve host" , ex ) ; } }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ev.equals ( ChangeCDModel.ExecutedEventDefinition ) ) { changeCD ( sender , args ) ; } else if ( ( ev.equals ( ConsoleModel.ErrorEventDefinition ) ) && ( sender instanceof org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel ) ) { SpiceConsoleModel_Error ( sender , ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ErrorCodeEventArgs ) ( args ) ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ev.equals ( ChangeCDModel.ExecutedEventDefinition ) ) { changeCD ( sender , args ) ; } }
Source:
public static 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 ) ; }

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 ) { return org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.List < ? > ) ( source ) ) ) ; } 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 void testConflictedUpdate ( ) throws java.lang.Exception { setUriInfo ( org.ovirt.engine.api.restapi.resource.AbstractBackendNetworkAttachmentResourceTest.setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , 0 , false ) ; control.replay ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment model = getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendNetworkAttachmentResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }

Target:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUriInfo ( org.ovirt.engine.api.restapi.resource.AbstractBackendNetworkAttachmentResourceTest.setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , 0 , false ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment model = getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendNetworkAttachmentResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }
Source:
public void parseLunFromXmlRpcReturnsUnknownForNoField ( ) throws java.lang.Exception { org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct xlun = org.mockito.Mockito.mock ( org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct.class ) ; org.mockito.Mockito.when ( xlun.contains ( GetDeviceListVDSCommand.DEVTYPE_FIELD ) ) . thenReturn ( false ) ; org.ovirt.engine.core.common.businessentities.LUNs lun = org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.ParseLunFromXmlRpc ( xlun ) ; org.junit.Assert.assertEquals ( StorageType.UNKNOWN , lun.getLunType ( ) ) ; }

Target:
public void parseLunFromXmlRpcReturnsUnknownForNoField ( ) throws java.lang.Exception { org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct xlun = new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct ( ) ; org.ovirt.engine.core.common.businessentities.LUNs lun = org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.ParseLunFromXmlRpc ( xlun ) ; org.junit.Assert.assertEquals ( StorageType.UNKNOWN , lun.getLunType ( ) ) ; }
Source:
void mockGetCaCertificate ( org.ovirt.engine.core.bll.ConfigureConsoleOptionsQuery query ) { org.mockito.Mockito.doReturn ( caCertificateReturnValue ) . when ( backend ) . runInternalQuery ( org.mockito.Matchers.eq ( VdcQueryType.GetCACertificate ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( caCertificateReturnValue ) . getSucceeded ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.ConfigureConsoleOptionsQueryTest.CA_CERTIFICATE ) . when ( caCertificateReturnValue ) . getReturnValue ( ) ; }

Target:
void mockGetCaCertificate ( ) { org.mockito.Mockito.doReturn ( caCertificateReturnValue ) . when ( backend ) . runInternalQuery ( org.mockito.Matchers.eq ( VdcQueryType.GetCACertificate ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( caCertificateReturnValue ) . getSucceeded ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.ConfigureConsoleOptionsQueryTest.CA_CERTIFICATE ) . when ( caCertificateReturnValue ) . getReturnValue ( ) ; }
Source:
public java.util.concurrent.Future < org.ovirt.vdsm.jsonrpc.client.JsonRpcResponse > call ( org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest req ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { final org.ovirt.vdsm.jsonrpc.client.internal.Call call = new org.ovirt.vdsm.jsonrpc.client.internal.Call ( req ) ; this . tracker.registerCall ( req , call ) ; this . getClient ( ) . sendMessage ( org.ovirt.vdsm.jsonrpc.client.utils.JsonUtils.jsonToByteArray ( req.toJson ( ) ) ) ; retryCall ( req , call ) ; return call ; }

Target:
public java.util.concurrent.Future < org.ovirt.vdsm.jsonrpc.client.JsonRpcResponse > call ( org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest req ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { final org.ovirt.vdsm.jsonrpc.client.internal.Call call = new org.ovirt.vdsm.jsonrpc.client.internal.Call ( req ) ; this . tracker.registerCall ( req , call ) ; try { this . getClient ( ) . sendMessage ( org.ovirt.vdsm.jsonrpc.client.utils.JsonUtils.jsonToByteArray ( req.toJson ( ) ) ) ; } finally { retryCall ( req , call ) ; } return call ; }
Source:
public void testGet ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDiskResourceTest.DISK_ID } , getEntity ( 1 ) ) ; control.replay ( ) ; org.ovirt.engine.api.model.Disk disk = resource.get ( ) ; org.ovirt.engine.api.restapi.resource.BackendDiskResourceTest.verifyModelSpecific ( disk , 1 ) ; verifyLinks ( disk ) ; }

Target:
public void testGet ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDiskResourceTest.DISK_ID } , getEntity ( 1 ) ) ; org.ovirt.engine.api.model.Disk disk = resource.get ( ) ; org.ovirt.engine.api.restapi.resource.BackendDiskResourceTest.verifyModelSpecific ( disk , 1 ) ; verifyLinks ( disk ) ; }
Source:
private java.lang.String getNetworkId ( java.lang.String networkName ) { org.ovirt.engine.api.restapi.resource.BackendVmNicsResource parent = ( ( org.ovirt.engine.api.restapi.resource.BackendVmNicsResource ) ( collection ) ) ; org.ovirt.engine.core.compat.Guid clusterId = parent.getClusterId ( ) ; org.ovirt.engine.api.model.Network n = parent.getClusterNetwork ( clusterId , null , networkName ) ; if ( n != null ) { return n.getId ( ) . toString ( ) ; } return null ; }

Target:
private java.lang.String getNetworkId ( java.lang.String networkName ) { if ( networkName != null ) { org.ovirt.engine.api.restapi.resource.BackendVmNicsResource parent = ( ( org.ovirt.engine.api.restapi.resource.BackendVmNicsResource ) ( collection ) ) ; org.ovirt.engine.core.compat.Guid clusterId = parent.getClusterId ( ) ; org.ovirt.engine.api.model.Network n = parent.getClusterNetwork ( clusterId , null , networkName ) ; if ( n != null ) { return n.getId ( ) . toString ( ) ; } } return null ; }
Source:
public void isConnectionForISCSIDomainAttached ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections connection = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; connection.setid ( "0cc146e8-e5ed-482c-8814-270bc48c297e" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = getConnections ( ) ; connections.add ( connection ) ; org.mockito.Mockito.doReturn ( connections ) . when ( validator ) . getAllConnectionsForDomain ( domain.getId ( ) ) ; org.junit.Assert.assertTrue ( validator.isConnectionForISCSIDomainAttached ( domain ) ) ; }

Target:
public void isConnectionForISCSIDomainAttached ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections connection = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; connection.setId ( "0cc146e8-e5ed-482c-8814-270bc48c297e" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = getConnections ( ) ; connections.add ( connection ) ; org.mockito.Mockito.doReturn ( connections ) . when ( validator ) . getAllConnectionsForDomain ( domain.getId ( ) ) ; org.junit.Assert.assertTrue ( validator.isConnectionForISCSIDomainAttached ( domain ) ) ; }
Source:
static void verifyModelSpecific ( org.ovirt.engine.api.model.Disk model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertTrue ( model.isSetVm ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.AbstractBackendDisksResourceTest.PARENT_ID.toString ( ) , model.getVm ( ) . getId ( ) ) ; assertTrue ( model.isSparse ( ) ) ; assertTrue ( ( ! ( model.isBootable ( ) ) ) ) ; assertTrue ( model.isPropagateErrors ( ) ) ; }

Target:
static void verifyModelSpecific ( org.ovirt.engine.api.model.Disk model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertTrue ( model.isSparse ( ) ) ; assertTrue ( ( ! ( model.isBootable ( ) ) ) ) ; assertTrue ( model.isPropagateErrors ( ) ) ; }
Source:
private org.ovirt.engine.core.common.action.VdcReturnValueBase addVmFromScratch ( org.ovirt.engine.core.common.businessentities.VmStatic vmStatic ) { org.ovirt.engine.core.common.action.AddVmFromScratchParameters parameters = new org.ovirt.engine.core.common.action.AddVmFromScratchParameters ( vmStatic , org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getDiskInfoList ( ) , org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getStorageDomainId ( ) ) ; parameters.setSessionId ( org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getSessionId ( ) ) ; parameters.setDontAttachToDefaultTag ( true ) ; return org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.AddVmFromScratch , parameters , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContexForTasks ( org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getExecutionContext ( ) ) ) ; }

Target:
private org.ovirt.engine.core.common.action.VdcReturnValueBase addVmFromScratch ( org.ovirt.engine.core.common.businessentities.VmStatic vmStatic ) { org.ovirt.engine.core.common.action.AddVmFromScratchParameters parameters = new org.ovirt.engine.core.common.action.AddVmFromScratchParameters ( vmStatic , org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getDiskInfoList ( ) , org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getStorageDomainId ( ) ) ; parameters.setSessionId ( org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getSessionId ( ) ) ; parameters.setDontAttachToDefaultTag ( true ) ; return runInternalAction ( VdcActionType.AddVmFromScratch , parameters , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContexForTasks ( org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getExecutionContext ( ) ) ) ; }
Source:
protected boolean performImagesChecks ( org.ovirt.engine.core.common.businessentities.VM vm ) { return org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( vm , org.ovirt.engine.core.bll.AddDiskCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , vm.getStoragePoolId ( ) , getStorageDomainId ( ) . getValue ( ) , false , true , false , false , false , true , java.util.Collections.< org.ovirt.engine.core.common.businessentities.Disk > emptyList ( ) ) ; }

Target:
protected boolean performImagesChecks ( org.ovirt.engine.core.common.businessentities.VM vm ) { return org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( vm.getId ( ) , org.ovirt.engine.core.bll.AddDiskCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , vm.getStoragePoolId ( ) , getStorageDomainId ( ) . getValue ( ) , false , true , false , false , false , true , java.util.Collections.< org.ovirt.engine.core.common.businessentities.Disk > emptyList ( ) ) ; }
Source:
private org.ovirt.engine.core.common.utils.Pair < java.util.List < org.ovirt.engine.core.compat.Guid > , org.ovirt.engine.core.compat.Guid > internalRunBalance ( org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl policyUnit , org.ovirt.engine.core.common.businessentities.VDSGroup cluster ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts = getVdsDAO ( ) . getAllOfTypes ( new org.ovirt.engine.core.common.businessentities.VDSType [ ] { org.ovirt.engine.core.common.businessentities.VDSType.VDS , org.ovirt.engine.core.common.businessentities.VDSType.oVirtNode } ) ; return policyUnit.balance ( cluster , hosts , cluster.getClusterPolicyProperties ( ) , new java.util.ArrayList < java.lang.String > ( ) ) ; }

Target:
private org.ovirt.engine.core.common.utils.Pair < java.util.List < org.ovirt.engine.core.compat.Guid > , org.ovirt.engine.core.compat.Guid > internalRunBalance ( org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl policyUnit , org.ovirt.engine.core.common.businessentities.VDSGroup cluster , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts ) { return policyUnit.balance ( cluster , hosts , cluster.getClusterPolicyProperties ( ) , new java.util.ArrayList < java.lang.String > ( ) ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVdsInterfacesByVdsId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID } , org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.setUpInterfaces ( ) , failure ) ; control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVdsInterfacesByVdsId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID } , org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.setUpInterfaces ( ) , failure ) ; }
Source:
public static void getHostPublicKey ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHPublicKey , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getHostPublicKey ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHPublicKey , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
protected void prePersist ( ) { if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( object.getId ( ) ) ) { object.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; } if ( org.apache.commons.lang.StringUtils.isEmpty ( object.getHostName ( ) ) ) { object.setHostName ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; } if ( ( object.getProtocol ( ) ) == null ) { object.setProtocol ( VdsProtocol.STOMP ) ; } }

Target:
protected void prePersist ( ) { if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( object.getId ( ) ) ) { object.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; } if ( org.apache.commons.lang.StringUtils.isEmpty ( object.getHostName ( ) ) ) { object.setHostName ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; } }
Source:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.RemoveGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID ) ) ) ; setUpMocksForRemove ( ) ; mockBackend ( true , null ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.times ( 1 ) ) . remove ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_REMOVED ) ; }

Target:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.RemoveGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID ) , null ) ) ; setUpMocksForRemove ( ) ; mockBackend ( true , null ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.times ( 1 ) ) . remove ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_REMOVED ) ; }
Source:
protected boolean detachStorage ( org.ovirt.engine.core.common.businessentities.StorageDomain dom ) { org.ovirt.engine.core.compat.Guid domId = dom.getId ( ) ; org.ovirt.engine.core.compat.Guid poolId = dom.getStoragePoolId ( ) . getValue ( ) ; org.ovirt.engine.core.common.action.DetachStorageDomainFromPoolParameters params = new org.ovirt.engine.core.common.action.DetachStorageDomainFromPoolParameters ( domId , poolId ) ; params.setDestroyingPool ( org.ovirt.engine.core.bll.storage.RemoveStorageDomainCommand.getParameters ( ) . getDestroyingPool ( ) ) ; return org.ovirt.engine.core.bll.storage.RemoveStorageDomainCommand.getBackend ( ) . runInternalAction ( VdcActionType.DetachStorageDomainFromPool , params ) . getSucceeded ( ) ; }

Target:
protected boolean detachStorage ( org.ovirt.engine.core.common.businessentities.StorageDomain dom ) { org.ovirt.engine.core.compat.Guid domId = dom.getId ( ) ; org.ovirt.engine.core.compat.Guid poolId = dom.getStoragePoolId ( ) ; org.ovirt.engine.core.common.action.DetachStorageDomainFromPoolParameters params = new org.ovirt.engine.core.common.action.DetachStorageDomainFromPoolParameters ( domId , poolId ) ; params.setDestroyingPool ( org.ovirt.engine.core.bll.storage.RemoveStorageDomainCommand.getParameters ( ) . getDestroyingPool ( ) ) ; return org.ovirt.engine.core.bll.storage.RemoveStorageDomainCommand.getBackend ( ) . runInternalAction ( VdcActionType.DetachStorageDomainFromPool , params ) . getSucceeded ( ) ; }
Source:
protected void writeManagedDeviceInfo ( org.ovirt.engine.core.common.businessentities.VmBase vmBase , org.ovirt.engine.core.utils.ovf.xml.XmlTextWriter writer , org.ovirt.engine.core.compat.Guid deviceId ) { org.ovirt.engine.core.common.businessentities.VmDevice vmDevice = vmBase.getManagedDeviceMap ( ) . get ( deviceId ) ; if ( ( ( deviceId != null ) && ( vmDevice != null ) ) && ( ( vmDevice.getAddress ( ) ) != null ) ) { writeVmDeviceInfo ( vmDevice ) ; } }

Target:
protected void writeManagedDeviceInfo ( org.ovirt.engine.core.common.businessentities.VmBase vmBase , org.ovirt.engine.core.compat.Guid deviceId ) { org.ovirt.engine.core.common.businessentities.VmDevice vmDevice = vmBase.getManagedDeviceMap ( ) . get ( deviceId ) ; if ( ( ( deviceId != null ) && ( vmDevice != null ) ) && ( ( vmDevice.getAddress ( ) ) != null ) ) { writeVmDeviceInfo ( vmDevice ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.core.common.businessentities.VmTemplate withVmInit = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( returnValue ) ) ; setupNewVmModel ( new org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ( new org.ovirt.engine.ui.uicommonweb.models.vms.NewVmFromTemplateModelBehavior ( withVmInit ) , this ) , withVmInit.getVmType ( ) , getSystemTreeSelectedItem ( ) , commands ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.businessentities.VmTemplate withVmInit ) { setupNewVmModel ( new org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ( new org.ovirt.engine.ui.uicommonweb.models.vms.NewVmFromTemplateModelBehavior ( withVmInit ) , this ) , withVmInit.getVmType ( ) , getSystemTreeSelectedItem ( ) , commands ) ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 , false , false , false ) ; setUpEntityQueryExpectations ( 1 , true , true , true ) ; setUpClusterExpectations ( GUIDS [ 1 ] ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateNetworkOnCluster , org.ovirt.engine.core.common.action.NetworkClusterParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyUpdate ( resource.update ( getModel ( 0 ) ) ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 , false , false , false , false ) ; setUpEntityQueryExpectations ( 1 , true , true , true , true ) ; setUpClusterExpectations ( GUIDS [ 1 ] ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateNetworkOnCluster , org.ovirt.engine.core.common.action.NetworkClusterParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyUpdate ( resource.update ( getModel ( 0 ) ) ) ; }
Source:
private void setUpDaoMocks ( ) { vmDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VmDao.class ) ; org.mockito.Mockito.doReturn ( vmDaoMock ) . when ( snapshotVmConfigurationHelper ) . getVmDao ( ) ; snapshotDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.SnapshotDao.class ) ; org.mockito.Mockito.doReturn ( snapshotDaoMock ) . when ( snapshotVmConfigurationHelper ) . getSnapshotDao ( ) ; diskImageDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.DiskImageDao.class ) ; org.mockito.Mockito.doReturn ( diskImageDaoMock ) . when ( snapshotVmConfigurationHelper ) . getDiskImageDao ( ) ; org.mockito.Mockito.when ( diskImageDaoMock.get ( existingImageId ) ) . thenReturn ( existingDiskImage ) ; }

Target:
private void setUpDaoMocks ( ) { vmDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VmDao.class ) ; org.mockito.Mockito.doReturn ( vmDaoMock ) . when ( snapshotVmConfigurationHelper ) . getVmDao ( ) ; org.mockito.Mockito.doReturn ( snapshotDaoMock ) . when ( snapshotVmConfigurationHelper ) . getSnapshotDao ( ) ; diskImageDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.DiskImageDao.class ) ; org.mockito.Mockito.doReturn ( diskImageDaoMock ) . when ( snapshotVmConfigurationHelper ) . getDiskImageDao ( ) ; org.mockito.Mockito.when ( diskImageDaoMock.get ( existingImageId ) ) . thenReturn ( existingDiskImage ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.VmWatchdogAction map ( org.ovirt.engine.api.model.WatchdogAction action , org.ovirt.engine.core.common.businessentities.VmWatchdogAction incoming ) { switch ( action ) { case DUMP : return org.ovirt.engine.core.common.businessentities.VmWatchdogAction.DUMP ; case NONE : return org.ovirt.engine.core.common.businessentities.VmWatchdogAction.NONE ; case PAUSE : return org.ovirt.engine.core.common.businessentities.VmWatchdogAction.PAUSE ; case POWEROFF : return org.ovirt.engine.core.common.businessentities.VmWatchdogAction.POWEROFF ; case RESET : return org.ovirt.engine.core.common.businessentities.VmWatchdogAction.RESET ; default : return null ; } }

Target:
public static org.ovirt.engine.core.common.businessentities.VmWatchdogAction map ( org.ovirt.engine.api.model.WatchdogAction action ) { switch ( action ) { case DUMP : return org.ovirt.engine.core.common.businessentities.VmWatchdogAction.DUMP ; case NONE : return org.ovirt.engine.core.common.businessentities.VmWatchdogAction.NONE ; case PAUSE : return org.ovirt.engine.core.common.businessentities.VmWatchdogAction.PAUSE ; case POWEROFF : return org.ovirt.engine.core.common.businessentities.VmWatchdogAction.POWEROFF ; case RESET : return org.ovirt.engine.core.common.businessentities.VmWatchdogAction.RESET ; default : return null ; } }
Source:
public void validateSucceeds ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( HOST_ID , "brick1" , "/gluster-bricks/brick1" , org.ovirt.engine.core.common.businessentities.RaidType.RAID0 , null , null , java.util.Arrays.asList ( getStorageDevice ( "sda" , null ) ) ) ) ) ; prepareMocks ( cmd , VDSStatus.Up ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; }

Target:
public void validateSucceeds ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( HOST_ID , "brick1" , "/gluster-bricks/brick1" , org.ovirt.engine.core.common.businessentities.RaidType.RAID0 , null , null , java.util.Arrays.asList ( getStorageDevice ( "sda" , null ) ) ) , null ) ) ; prepareMocks ( cmd , VDSStatus.Up ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; }
Source:
public void unmanagedVlanAddedToNic ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface nic = createNic ( "nic0" , null ) ; mockExistingIfaces ( nic ) ; java.lang.String networkName = "net" ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic , createVlan ( nic.getName ( ) , 100 , networkName ) ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORKS_DONT_EXIST_IN_CLUSTER , networkName ) ; }

Target:
public void unmanagedVlanAddedToNic ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNic ( "nic0" , null ) ; mockExistingIfaces ( nic ) ; java.lang.String networkName = "net" ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic , createVlan ( nic.getName ( ) , 100 , networkName ) ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORKS_DONT_EXIST_IN_CLUSTER , networkName ) ; }
Source:
public boolean shouldVdsBeFenced ( ) { boolean result = false ; switch ( vds.getStatus ( ) ) { case Down : case InstallFailed : case Maintenance : case NonOperational : case NonResponsive : result = true ; break ; default : break ; } return result ; }

Target:
public boolean shouldVdsBeFenced ( ) { boolean result = false ; if ( ( vds ) == null ) { return false ; } switch ( vds.getStatus ( ) ) { case Down : case InstallFailed : case Maintenance : case NonOperational : case NonResponsive : result = true ; break ; default : break ; } return result ; }
Source:
public java.lang.Void runInTransaction ( ) { jobDao.save ( job ) ; java.util.Set < java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > > entrySet = job.getJobSubjectEntities ( ) . entrySet ( ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > entry : entrySet ) { jobSubjectEntityDao.save ( job.getId ( ) , entry.getKey ( ) , entry.getValue ( ) ) ; } return null ; }

Target:
public java.lang.Void runInTransaction ( ) { jobDao.save ( job ) ; return null ; }
Source:
private java.util.concurrent.FutureTask < org.ovirt.engine.core.common.eventqueue.EventResult > addTaskToQueue ( org.ovirt.engine.core.common.eventqueue.Event event , java.util.concurrent.Callable < org.ovirt.engine.core.common.eventqueue.EventResult > callable , org.ovirt.engine.core.compat.Guid storagePoolId , boolean addFirst ) { java.util.concurrent.FutureTask < org.ovirt.engine.core.common.eventqueue.EventResult > task = new java.util.concurrent.FutureTask < org.ovirt.engine.core.common.eventqueue.EventResult > ( callable ) ; org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.eventqueue.Event , java.util.concurrent.FutureTask < org.ovirt.engine.core.common.eventqueue.EventResult > > queueEvent = new org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.eventqueue.Event , java.util.concurrent.FutureTask < org.ovirt.engine.core.common.eventqueue.EventResult > > ( event , task ) ; if ( addFirst ) { getEventQueue ( storagePoolId ) . addFirst ( queueEvent ) ; } else { getEventQueue ( storagePoolId ) . add ( queueEvent ) ; } return task ; }

Target:
private java.util.concurrent.FutureTask < org.ovirt.engine.core.common.eventqueue.EventResult > addTaskToQueue ( org.ovirt.engine.core.common.eventqueue.Event event , java.util.concurrent.Callable < org.ovirt.engine.core.common.eventqueue.EventResult > callable , org.ovirt.engine.core.compat.Guid storagePoolId , boolean addFirst ) { java.util.concurrent.FutureTask < org.ovirt.engine.core.common.eventqueue.EventResult > task = new java.util.concurrent.FutureTask ( callable ) ; org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.eventqueue.Event , java.util.concurrent.FutureTask < org.ovirt.engine.core.common.eventqueue.EventResult > > queueEvent = new org.ovirt.engine.core.common.utils.Pair ( event , task ) ; if ( addFirst ) { getEventQueue ( storagePoolId ) . addFirst ( queueEvent ) ; } else { getEventQueue ( storagePoolId ) . add ( queueEvent ) ; } return task ; }
Source:
public javax.ws.rs.core.Response get ( ) { java.net.URI uri = java.net.URI.create ( org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( getUriInfo ( ) , newModel ( id ) ) . getHref ( ) ) ; javax.ws.rs.core.Response.Status status = Response.Status.MOVED_PERMANENTLY ; return javax.ws.rs.core.Response.status ( status ) . location ( uri ) . build ( ) ; }

Target:
public javax.ws.rs.core.Response get ( ) { java.net.URI uri = java.net.URI.create ( org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( newModel ( id ) ) . getHref ( ) ) ; javax.ws.rs.core.Response.Status status = Response.Status.MOVED_PERMANENTLY ; return javax.ws.rs.core.Response.status ( status ) . location ( uri ) . build ( ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAffinityGroupsByClusterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , setUpAffinityGroups ( ) , failure ) ; control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAffinityGroupsByClusterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , setUpAffinityGroups ( ) , failure ) ; }
Source:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Network model = new org.ovirt.engine.api.model.Network ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Network" , "add" , "name" ) ; } }

Target:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Network model = new org.ovirt.engine.api.model.Network ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Network" , "add" , "name" ) ; } }
Source:
protected void UpdateActionAvailability ( ) { super . UpdateActionAvailability ( ) ; getConnectCommand ( ) . setIsExecutionAllowed ( ( ( ( ( ( getEntity ( ) ) != null ) && ( ( ( getEntity ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) || ( ( getEntity ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.PoweringDown ) ) ) ) && ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.IsWindowsOsType ( getEntity ( ) . getVmOs ( ) ) ) ) && ( getConfigurator ( ) . isClientWindownsExplorer ( ) ) ) ) ; }

Target:
protected void UpdateActionAvailability ( ) { super . UpdateActionAvailability ( ) ; getConnectCommand ( ) . setIsExecutionAllowed ( ( ( ( ( getEntity ( ) ) != null ) && ( ( ( getEntity ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) || ( ( getEntity ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.PoweringDown ) ) ) ) && ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.IsWindowsOsType ( getEntity ( ) . getVmOs ( ) ) ) ) ) ; }
Source:
private void parseSecondArgWithKeyValue ( java.lang.String arg , java.lang.String key , java.lang.String value ) { if ( isSetOrMergeAction ( ) ) { engineConfigMap.setKey ( key ) ; engineConfigMap.setValue ( value ) ; } else { org.ovirt.engine.core.config.EngineConfigCLIParser.log.debug ( ( ( "parseArguments error: second argument '" + arg ) + "' has an '=' char but action is not 'set'." ) ) ; throw new java.lang.IllegalArgumentException ( ( ( "Illegal second argument: " + arg ) + "." ) ) ; } }

Target:
private void parseSecondArgWithKeyValue ( java.lang.String arg , java.lang.String key , java.lang.String value ) { if ( isSetOrMergeAction ( ) ) { engineConfigMap.setKey ( key ) ; engineConfigMap.setValue ( value ) ; } else { throw new java.lang.IllegalArgumentException ( ( ( "Illegal second argument: " + arg ) + "." ) ) ; } }