auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private boolean _doConnect ( java.lang.String server , java.lang.String user , java.lang.String userPassword , java.lang.String keyStore , java.lang.String keyStorePassword ) { return _doConnect ( server , user , userPassword , keyStore , keyStorePassword , ( ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.SSHInactivityTimoutSeconds ) ) * 1000 ) ) ; }

Target:
private boolean _doConnect ( java.lang.String server , java.lang.String user , java.lang.String userPassword , java.lang.String keyStore , java.lang.String keyStorePassword ) { return _doConnect ( server , user , userPassword , keyStore , keyStorePassword , ( ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.SSHInactivityHardTimoutSeconds ) ) * 1000 ) , ( ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.SSHInactivityTimoutSeconds ) ) * 1000 ) ) ; }
Source:
private void removeUser ( ) { org.ovirt.engine.core.compat.Guid userId = getUser ( ) . getUserId ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.permissions > perms = org.ovirt.engine.core.itests.BasicTestSetup.DB_FACADE.getPermissionDAO ( ) . getAllForAdElement ( userId ) ; for ( org.ovirt.engine.core.common.businessentities.permissions p : perms ) { org.ovirt.engine.core.itests.BasicTestSetup.DB_FACADE.getPermissionDAO ( ) . remove ( p.getId ( ) ) ; } org.ovirt.engine.core.itests.BasicTestSetup.DB_FACADE.getDbUserDAO ( ) . remove ( userId ) ; java.lang.System.out.println ( ( ( "-- removed user " + ( getUser ( ) . getUserName ( ) ) ) + " and its permissions -- " ) ) ; }

Target:
private void removeUser ( ) { org.ovirt.engine.core.compat.Guid userId = getUser ( ) . getUserId ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.permissions > perms = org.ovirt.engine.core.itests.BasicTestSetup.DB_FACADE.getPermissionDao ( ) . getAllForAdElement ( userId ) ; for ( org.ovirt.engine.core.common.businessentities.permissions p : perms ) { org.ovirt.engine.core.itests.BasicTestSetup.DB_FACADE.getPermissionDao ( ) . remove ( p.getId ( ) ) ; } org.ovirt.engine.core.itests.BasicTestSetup.DB_FACADE.getDbUserDao ( ) . remove ( userId ) ; java.lang.System.out.println ( ( ( "-- removed user " + ( getUser ( ) . getUserName ( ) ) ) + " and its permissions -- " ) ) ; }
Source:
private org.ovirt.engine.api.model.NetworkAttachments mapCollection ( java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > networkAttachments ) { org.ovirt.engine.api.model.NetworkAttachments collection = new org.ovirt.engine.api.model.NetworkAttachments ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment : networkAttachments ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment entity = populate ( map ( attachment ) , attachment ) ; collection.getNetworkAttachments ( ) . add ( addLinks ( entity , getParentClass ( ) ) ) ; } return collection ; }

Target:
private org.ovirt.engine.api.model.NetworkAttachments mapCollection ( java.util.List < org.ovirt.engine.api.model.NetworkAttachment > networkAttachments ) { org.ovirt.engine.api.model.NetworkAttachments collection = new org.ovirt.engine.api.model.NetworkAttachments ( ) ; for ( org.ovirt.engine.api.model.NetworkAttachment networkAttachmentEntity : networkAttachments ) { org.ovirt.engine.api.model.NetworkAttachment networkAttachmentModel = populate ( map ( networkAttachmentEntity ) , networkAttachmentEntity ) ; collection.getNetworkAttachments ( ) . add ( addLinks ( networkAttachmentModel , getParentClass ( ) ) ) ; } return collection ; }
Source:
static void checkMessages ( ) { org.ovirt.engine.core.common.AuditLogType [ ] values = org.ovirt.engine.core.common.AuditLogType.values ( ) ; if ( ( values.length ) != ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.mMessages.size ( ) ) ) { for ( org.ovirt.engine.core.common.AuditLogType value : values ) { if ( ! ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.mMessages.containsKey ( value ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.infoFormat ( "AuditLogType: {0} not exist in string table" , value.toString ( ) ) ; } } } }

Target:
private static void checkMessages ( ) { org.ovirt.engine.core.common.AuditLogType [ ] values = org.ovirt.engine.core.common.AuditLogType.values ( ) ; if ( ( values.length ) != ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.messages.size ( ) ) ) { for ( org.ovirt.engine.core.common.AuditLogType value : values ) { if ( ! ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.messages.containsKey ( value ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.infoFormat ( "AuditLogType: {0} not exist in string table" , value.toString ( ) ) ; } } } }
Source:
public void testValidateClusterSupportForVirtioScsi ( ) { org.ovirt.engine.core.bll.ImportVmCommand < org.ovirt.engine.core.common.action.ImportVmParameters > cmd = setupDiskSpaceTest ( createParameters ( ) ) ; cmd.getParameters ( ) . getVm ( ) . getDiskMap ( ) . values ( ) . iterator ( ) . next ( ) . setDiskInterface ( DiskInterface.VirtIO_SCSI ) ; cmd.getVdsGroup ( ) . setCompatibilityVersion ( Version.v3_2 ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , VdcBllMessages.VIRTIO_SCSI_INTERFACE_IS_NOT_AVAILABLE_FOR_CLUSTER_LEVEL ) ; }

Target:
public void testValidateClusterSupportForVirtioScsi ( ) { org.ovirt.engine.core.bll.ImportVmCommand < org.ovirt.engine.core.common.action.ImportVmParameters > cmd = setupDiskSpaceTest ( createParameters ( ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateImages ( org.mockito.Matchers.any ( java.util.Map.class ) ) ; cmd.getParameters ( ) . getVm ( ) . getDiskMap ( ) . values ( ) . iterator ( ) . next ( ) . setDiskInterface ( DiskInterface.VirtIO_SCSI ) ; cmd.getVdsGroup ( ) . setCompatibilityVersion ( Version.v3_2 ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , VdcBllMessages.VIRTIO_SCSI_INTERFACE_IS_NOT_AVAILABLE_FOR_CLUSTER_LEVEL ) ; }
Source:
public void updateFormItem ( org.ovirt.engine.ui.common.widget.form.FormItem item ) { updateFormItem ( item , 6 ) ; }

Target:
private void updateItemSizes ( org.ovirt.engine.ui.common.widget.form.FormItem item , int labelWidth , int valueWidth ) { java.util.List < java.lang.Integer > sizesList = formSizeMap.get ( item ) ; if ( sizesList == null ) { sizesList = new java.util.ArrayList < > ( ) ; formSizeMap.put ( item , sizesList ) ; } sizesList.clear ( ) ; sizesList.add ( labelWidth ) ; sizesList.add ( valueWidth ) ; }
Source:
private static boolean hasTaskCompleted ( org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask task ) { if ( ( ( ( org.ovirt.engine.core.common.job.JobExecutionStatus.ABORTED ) == ( task.getStatus ( ) ) ) || ( ( ( org.ovirt.engine.core.common.job.JobExecutionStatus.FINISHED ) == ( task.getStatus ( ) ) ) && ( ( task.getType ( ) ) != ( org.ovirt.engine.core.common.asynctasks.gluster.GlusterTaskType.REMOVE_BRICK ) ) ) ) || ( ( org.ovirt.engine.core.common.job.JobExecutionStatus.FAILED ) == ( task.getStatus ( ) ) ) ) { return true ; } return false ; }

Target:
public org.ovirt.engine.core.bll.gluster.tasks.GlusterTaskUtils getGlusterTaskUtils ( ) { return org.ovirt.engine.core.bll.gluster.tasks.GlusterTaskUtils.getInstance ( ) ; }
Source:
private void persistEngineSession ( java.lang.String sessionId ) { org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo sessionInfo = getSessionInfo ( sessionId ) ; if ( sessionInfo != null ) { sessionInfo.contentOfSession.put ( org.ovirt.engine.core.bll.aaa.SessionDataContainer.ENGINE_SESSION_SEQ_ID , getDbFacade ( ) . getEngineSessionDao ( ) . save ( new org.ovirt.engine.core.common.businessentities.EngineSession ( getUser ( sessionId , false ) , sessionId ) ) ) ; } }

Target:
private void persistEngineSession ( java.lang.String sessionId ) { org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo sessionInfo = getSessionInfo ( sessionId ) ; if ( sessionInfo != null ) { sessionInfo.contentOfSession.put ( org.ovirt.engine.core.bll.aaa.SessionDataContainer.ENGINE_SESSION_SEQ_ID , engineSessionDao.save ( new org.ovirt.engine.core.common.businessentities.EngineSession ( getUser ( sessionId , false ) , sessionId ) ) ) ; } }
Source:
private org.ovirt.engine.core.compat.Guid getStorageDomainIdForPoolByType ( org.ovirt.engine.core.compat.Guid pool , org.ovirt.engine.core.common.businessentities.StorageDomainType type ) { org.ovirt.engine.core.compat.Guid returnValue = org.ovirt.engine.core.compat.Guid.Empty ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = getAllForStoragePool ( pool ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : domains ) { if ( ( domain.getstorage_domain_type ( ) ) == type ) { returnValue = domain.getId ( ) ; break ; } } return returnValue ; }

Target:
private org.ovirt.engine.core.compat.Guid getStorageDomainIdForPoolByType ( org.ovirt.engine.core.compat.Guid pool , org.ovirt.engine.core.common.businessentities.StorageDomainType type ) { org.ovirt.engine.core.compat.Guid returnValue = org.ovirt.engine.core.compat.Guid.Empty ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = getAllForStoragePool ( pool ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : domains ) { if ( ( domain.getStorageDomainType ( ) ) == type ) { returnValue = domain.getId ( ) ; break ; } } return returnValue ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.storage.AddNetworkCommand.getParameters ( ) . getNetwork ( ) . setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDao ( ) . save ( org.ovirt.engine.core.bll.storage.AddNetworkCommand.getParameters ( ) . getNetwork ( ) ) ; org.ovirt.engine.core.bll.storage.AddNetworkCommand.getReturnValue ( ) . setActionReturnValue ( org.ovirt.engine.core.bll.storage.AddNetworkCommand.getParameters ( ) . getNetwork ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.storage.AddNetworkCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.storage.AddNetworkCommand.getParameters ( ) . getNetwork ( ) . setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDao ( ) . save ( org.ovirt.engine.core.bll.storage.AddNetworkCommand.getParameters ( ) . getNetwork ( ) ) ; addPermissions ( ) ; org.ovirt.engine.core.bll.storage.AddNetworkCommand.getReturnValue ( ) . setActionReturnValue ( org.ovirt.engine.core.bll.storage.AddNetworkCommand.getParameters ( ) . getNetwork ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.storage.AddNetworkCommand.setSucceeded ( true ) ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel localStorageModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel ) ( target ) ) ; org.ovirt.engine.core.common.businessentities.storage_server_connections connection = ( ( org.ovirt.engine.core.common.businessentities.storage_server_connections ) ( returnValue ) ) ; localStorageModel.getPath ( ) . setEntity ( connection.getconnection ( ) ) ; }

Target:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel localStorageModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel ) ( target ) ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections connection = ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( returnValue ) ) ; localStorageModel.getPath ( ) . setEntity ( connection.getconnection ( ) ) ; }
Source:
public void render ( org.ovirt.engine.ui.webadmin.widget.table.cell.Context context , T value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb , java.lang.String id ) { if ( ! ( isVisible ( value ) ) ) { return ; } com.google.gwt.resources.client.ImageResource image = resources.expanderDownImage ( ) ; com.google.gwt.safehtml.shared.SafeHtml imageHtml = com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( image ) . getHTML ( ) ) ; sb.append ( templates.volumeActivityMenu ( imageHtml , id ) ) ; }

Target:
public void render ( org.ovirt.engine.ui.webadmin.widget.table.cell.Context context , T value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb , java.lang.String id ) { if ( ! ( isVisible ( value ) ) ) { return ; } com.google.gwt.resources.client.ImageResource image = org.ovirt.engine.ui.webadmin.widget.table.cell.MenuCell.resources.expanderDownImage ( ) ; com.google.gwt.safehtml.shared.SafeHtml imageHtml = com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( image ) . getHTML ( ) ) ; sb.append ( org.ovirt.engine.ui.webadmin.widget.table.cell.MenuCell.templates.volumeActivityMenu ( imageHtml , id ) ) ; }
Source:
public void shouldValidateSingleNodePinning ( ) { vm.setvNumaNodeList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 , java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVdsNumaNode ( 1 ) ) ) ) ) ; vm.setNumaTuneMode ( NumaTuneMode.PREFERRED ) ; assertTrue ( org.ovirt.engine.core.bll.numa.vm.NumaValidator.checkVmNumaNodesIntegrity ( vm , vm.getvNumaNodeList ( ) ) . isValid ( ) ) ; }

Target:
public void shouldValidateSingleNodePinning ( ) { vm.setvNumaNodeList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 , java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVdsNumaNode ( 1 ) ) ) ) ) ; vm.setNumaTuneMode ( NumaTuneMode.PREFERRED ) ; org.junit.Assert.assertTrue ( org.ovirt.engine.core.bll.numa.vm.NumaValidator.checkVmNumaNodesIntegrity ( vm , vm.getvNumaNodeList ( ) ) . isValid ( ) ) ; }
Source:
public void legalTimedOut ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.TimeoutBaseTest.TestTimeoutBase t = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.TimeoutBaseTest.TestTimeoutBase ( ) ; t.setUseTimout ( true ) ; long c = java.lang.System.currentTimeMillis ( ) ; c -= 1000 ; final java.util.Date d = new java.util.Date ( c ) ; t.setEndTime ( d ) ; final java.lang.String s = "timeout" ; t.setTimeoutObjectId ( s ) ; t.getLegal ( ) ; final boolean result = t.getLegal ( ) ; org.junit.Assert.assertTrue ( result ) ; }

Target:
public void legalTimedOut ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.TimeoutBaseTest.TestTimeoutBase t = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.TimeoutBaseTest.TestTimeoutBase ( ) ; t.setUseTimout ( true ) ; long c = java.lang.System.currentTimeMillis ( ) ; c -= 1000 ; final java.util.Date d = new java.util.Date ( c ) ; t.setEndTime ( d ) ; final java.lang.String s = "legal-timeout" ; t.setTimeoutObjectId ( s ) ; t.getLegal ( ) ; final boolean result = t.getLegal ( ) ; org.junit.Assert.assertTrue ( result ) ; }
Source:
private void assertReturnedRange ( java.util.List < org.ovirt.engine.core.bll.network.macpool.Range > ranges , org.ovirt.engine.core.bll.network.macpool.MacsStorage macsStorage , java.util.List < java.lang.Integer > expectedRangeIndices ) { for ( int expectedRangeIndex : expectedRangeIndices ) { org.ovirt.engine.core.bll.network.macpool.Range actualRange = macsStorage.getRangeWithAvailableMac ( ) ; org.ovirt.engine.core.bll.network.macpool.Range expectedRange = ranges.get ( expectedRangeIndex ) ; org.junit.Assert.assertThat ( actualRange , new org.hamcrest.core.IsSame ( expectedRange ) ) ; } }

Target:
private void assertReturnedRange ( java.util.List < org.ovirt.engine.core.bll.network.macpool.Range > ranges , org.ovirt.engine.core.bll.network.macpool.MacsStorage macsStorage , java.util.List < java.lang.Integer > expectedRangeIndices ) { for ( int expectedRangeIndex : expectedRangeIndices ) { org.ovirt.engine.core.bll.network.macpool.Range actualRange = macsStorage.getRangeWithAvailableMac ( ) ; org.ovirt.engine.core.bll.network.macpool.Range expectedRange = ranges.get ( expectedRangeIndex ) ; org.hamcrest.MatcherAssert.assertThat ( actualRange , new org.hamcrest.core.IsSame ( expectedRange ) ) ; } }
Source:
public void nGuidGuidCtor ( ) { b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID2 ) ; final org.ovirt.engine.core.compat.Guid g = b.getVdsId ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , g ) ; final org.ovirt.engine.core.compat.Guid gu = b.getVmId ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID2 , gu ) ; }

Target:
public void nGuidGuidCtor ( ) { b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID2 ) ; final org.ovirt.engine.core.compat.Guid g = b.getVdsId ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , g ) ; final org.ovirt.engine.core.compat.Guid gu = b.getVmId ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID2 , gu ) ; }
Source:
private void OnApproveInternal ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( getSelectedItem ( ) ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( VdcActionType.ApproveVds , new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.action.VdcActionParametersBase [ ] { new org.ovirt.engine.core.common.action.ApproveVdsParameters ( vds.getId ( ) ) } ) ) , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void Executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , null ) ; }

Target:
private void onApproveInternal ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( getSelectedItem ( ) ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( VdcActionType.ApproveVds , new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.action.VdcActionParametersBase [ ] { new org.ovirt.engine.core.common.action.ApproveVdsParameters ( vds.getId ( ) ) } ) ) , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , null ) ; }
Source:
public void canDoActionImagesNotFound ( ) { command.getParameters ( ) . setParametersList ( createMoveDisksParameters ( ) ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_NOT_EXIST.toString ( ) ) ) ; }

Target:
public void moveDisk ( ) { command.getParameters ( ) . setParametersList ( createMoveDisksParameters ( ) ) ; initDiskImage ( diskImageId ) ; initVm ( VMStatus.Down , null , diskImageId ) ; command.updateParameters ( ) ; org.junit.Assert.assertTrue ( ( ( command.getMoveDiskParametersList ( ) . size ( ) ) == 1 ) ) ; }
Source:
public void testChangeCdNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( null ) ; try { resource.update ( getCdrom ( org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.B_ISO ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testChangeCdNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( null ) ; try { resource.update ( getCdrom ( org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.B_ISO ) ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void getVmsRunningOnOrMigratingToVds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntity ( masterDomain.getStorageStaticData ( ) ) ; masterDomain.setStorageDomainType ( StorageDomainType.Data ) ; getDbFacade ( ) . getStorageDomainStaticDao ( ) . update ( masterDomain.getStorageStaticData ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntity ( masterDomain.getStoragePoolIsoMapData ( ) ) ; masterDomain.setStatus ( StorageDomainStatus.Locked ) ; getDbFacade ( ) . getStoragePoolIsoMapDao ( ) . update ( masterDomain.getStoragePoolIsoMapData ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
protected void writeFile ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image ) { _writer.writeAttributeString ( org.ovirt.engine.core.utils.ovf.OVF_URI , "href" , image.getImageId ( ) . toString ( ) ) ; _writer.writeAttributeString ( org.ovirt.engine.core.utils.ovf.OVF_URI , "id" , image.getImageId ( ) . toString ( ) ) ; _writer.writeAttributeString ( org.ovirt.engine.core.utils.ovf.OVF_URI , "size" , java.lang.String.valueOf ( image.getActualSizeInBytes ( ) ) ) ; }

Target:
protected void writeFile ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image ) { _writer.writeAttributeString ( org.ovirt.engine.core.utils.ovf.OVF_PREFIX , org.ovirt.engine.core.utils.ovf.OVF_URI , "href" , image.getImageId ( ) . toString ( ) ) ; _writer.writeAttributeString ( org.ovirt.engine.core.utils.ovf.OVF_PREFIX , org.ovirt.engine.core.utils.ovf.OVF_URI , "id" , image.getImageId ( ) . toString ( ) ) ; _writer.writeAttributeString ( org.ovirt.engine.core.utils.ovf.OVF_PREFIX , org.ovirt.engine.core.utils.ovf.OVF_URI , "size" , java.lang.String.valueOf ( image.getActualSizeInBytes ( ) ) ) ; }
Source:
public void testUnsubscribe ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.EventSubscriber > before = dao.getAllForSubscriber ( existingSubscriber ) ; org.junit.Assert.assertFalse ( before.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.EventSubscriber subscriber : before ) { dao.unsubscribe ( subscriber ) ; } java.util.List < org.ovirt.engine.core.common.businessentities.EventSubscriber > after = dao.getAllForSubscriber ( existingSubscriber ) ; org.junit.Assert.assertNotNull ( after ) ; org.junit.Assert.assertTrue ( after.isEmpty ( ) ) ; }

Target:
public void testUnsubscribe ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.EventSubscriber > before = dao.getAllForSubscriber ( existingSubscriber ) ; org.junit.jupiter.api.Assertions.assertFalse ( before.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.EventSubscriber subscriber : before ) { dao.unsubscribe ( subscriber ) ; } java.util.List < org.ovirt.engine.core.common.businessentities.EventSubscriber > after = dao.getAllForSubscriber ( existingSubscriber ) ; org.junit.jupiter.api.Assertions.assertNotNull ( after ) ; org.junit.jupiter.api.Assertions.assertTrue ( after.isEmpty ( ) ) ; }
Source:
public void canDoActionThinProvisioningSpaceCheckSucceeds ( ) throws java.lang.Exception { final int availableSize = 6 ; final int usedSize = 4 ; org.ovirt.engine.core.compat.Guid sdid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( sdid , VolumeType.Sparse ) ; mockVm ( ) ; mockStorageDomain ( sdid , availableSize , usedSize ) ; mockStoragePoolIsoMap ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; }

Target:
public void canDoActionSpaceValidationFails ( ) { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( storageId , VolumeType.Sparse ) ; mockVm ( ) ; mockStorageDomain ( storageId ) ; mockStoragePoolIsoMap ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.AddDiskToVmCommandTest.mockStorageDomainValidatorWithoutSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_TARGET_STORAGE_DOMAIN.toString ( ) ) ) ; }
Source:
public void getGlusterSwiftServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByServerId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( serverId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }

Target:
public void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisksForVm , params , aQuery ) ; }
Source:
private void testStatusMapping ( org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus backendStatus , org.ovirt.engine.api.model.GlusterState restStatus ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brick = new org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity ( ) ; brick.setStatus ( backendStatus ) ; org.ovirt.engine.api.model.GlusterBrick restVolume = org.ovirt.engine.api.restapi.types.GlusterBrickMapper.map ( brick , null ) ; assertEquals ( restVolume.getStatus ( ) . getState ( ) , restStatus.value ( ) ) ; }

Target:
private void testStatusMapping ( org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus backendStatus , org.ovirt.engine.api.model.GlusterBrickStatus restStatus ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brick = new org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity ( ) ; brick.setStatus ( backendStatus ) ; org.ovirt.engine.api.model.GlusterBrick restBrick = org.ovirt.engine.api.restapi.types.GlusterBrickMapper.map ( brick , null ) ; assertEquals ( restBrick.getStatus ( ) , restStatus ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.SessionsListReturnForXmlRpc getSessionList ( ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getSessionList ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.SessionsListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.SessionsListReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc hotplugDisk ( java.util.Map info ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.hotplugDisk ( info ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public static void getUpHostListByCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { 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.uicommonweb.dataprovider.AsyncDataProvider.getUpHostListByCluster ( aQuery , clusterName , null ) ; }

Target:
public void getVmsRunningOnOrMigratingToVds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
protected org.ovirt.engine.core.common.action.VdcReturnValueBase attemptRollback ( org.ovirt.engine.core.common.action.VdcActionType commandType , org.ovirt.engine.core.common.action.VdcActionParametersBase params ) { if ( canPerformRollbackUsingCommand ( commandType , params ) ) { params.setExecutionReason ( CommandExecutionReason.ROLLBACK_FLOW ) ; params.setTransactionScopeOption ( TransactionScopeOption.RequiresNew ) ; return getBackend ( ) . runInternalAction ( commandType , params , context.clone ( ) ) ; } return new org.ovirt.engine.core.common.action.VdcReturnValueBase ( ) ; }

Target:
protected org.ovirt.engine.core.common.vdscommands.VDSReturnValue runVdsCommand ( org.ovirt.engine.core.common.vdscommands.VDSCommandType commandType , org.ovirt.engine.core.common.vdscommands.VDSParametersBase parameters ) throws org.ovirt.engine.core.common.errors.EngineException { return getVdsBroker ( ) . RunVdsCommand ( commandType , parameters ) ; }
Source:
public void init ( javax.servlet.ServletConfig config ) throws javax.servlet.ServletException { super . init ( config ) ; type = config.getInitParameter ( org.ovirt.engine.core.FileServlet.TYPE ) ; final java.lang.String name = config.getInitParameter ( org.ovirt.engine.core.FileServlet.FILE ) ; if ( name == null ) { final java.lang.String message = ( "Can\'t get base name from parameter \"" + ( org.ovirt.engine.core.FileServlet.FILE ) ) + "\"." ; org.ovirt.engine.core.FileServlet.log.error ( message ) ; throw new javax.servlet.ServletException ( message ) ; } base = new java.io.File ( org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) . expandString ( name ) ) ; }

Target:
public void init ( javax.servlet.ServletConfig config ) throws javax.servlet.ServletException { super . init ( config ) ; type = config.getInitParameter ( org.ovirt.engine.core.FileServlet.TYPE ) ; final java.lang.String name = config.getInitParameter ( org.ovirt.engine.core.FileServlet.FILE ) ; if ( name == null ) { final java.lang.String message = ( "Can\'t get base name from parameter \"" + ( org.ovirt.engine.core.FileServlet.FILE ) ) + "\"." ; org.ovirt.engine.core.FileServlet.log.error ( message ) ; throw new javax.servlet.ServletException ( message ) ; } base = new java.io.File ( org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) . expandString ( name.replaceAll ( "%\\{" , "\\${" ) ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult bootProtocolSetForRoleNetwork ( ) { org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = attachment.getIpConfiguration ( ) ; boolean failWhen = ( isRoleNetwork ( ) ) && ( ( ( ipConfiguration == null ) || ( ! ( ipConfiguration.hasIpv4PrimaryAddressSet ( ) ) ) ) || ( ( ipConfiguration.getIpv4PrimaryAddress ( ) . getBootProtocol ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.NONE ) ) ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator.VAR_ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL_ENTITY , getNetwork ( ) . getName ( ) ) ) . when ( failWhen ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult bootProtocolSetForRoleNetwork ( ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator.VAR_ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL_ENTITY , getNetwork ( ) . getName ( ) ) ) . unless ( validBootProtocolForRoleNetwork ( ) ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.network.host.GetNetworkAttachmentsByHostNicIdQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.network.host.GetNetworkAttachmentsByHostNicIdQuery.getDbFacade ( ) . getNetworkAttachmentDao ( ) . getAllForNic ( org.ovirt.engine.core.bll.network.host.GetNetworkAttachmentsByHostNicIdQuery.getParameters ( ) . getId ( ) ) ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.compat.Guid nicId = org.ovirt.engine.core.bll.network.host.GetNetworkAttachmentsByHostNicIdQuery.getParameters ( ) . getId ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > networkAttachments = networkAttachmentDao.getAllForNic ( nicId ) ; if ( ! ( networkAttachments.isEmpty ( ) ) ) { fillReportedConfigurations ( nicId , networkAttachments ) ; } org.ovirt.engine.core.bll.network.host.GetNetworkAttachmentsByHostNicIdQuery.getQueryReturnValue ( ) . setReturnValue ( networkAttachments ) ; }
Source:
public static void getRoleList ( 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.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }

Target:
public static void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
public void testRemoveNetworkAndReassignRolesNoReassign ( ) { testRemoveNetworkAndReassignRoles ( ) ; org.mockito.Mockito.verify ( networkClusterDao , org.mockito.Mockito.never ( ) ) . update ( org.mockito.ArgumentMatchers.same ( managementNetworkCluster ) ) ; org.junit.Assert.assertFalse ( managementNetworkCluster.isDisplay ( ) ) ; org.junit.Assert.assertFalse ( managementNetworkCluster.isMigration ( ) ) ; }

Target:
public void testRemoveNetworkAndReassignRolesNoReassign ( ) { testRemoveNetworkAndReassignRoles ( ) ; org.mockito.Mockito.verify ( networkClusterDao , org.mockito.Mockito.never ( ) ) . update ( org.mockito.Matchers.same ( managementNetworkCluster ) ) ; org.junit.Assert.assertFalse ( managementNetworkCluster.isDisplay ( ) ) ; org.junit.Assert.assertFalse ( managementNetworkCluster.isMigration ( ) ) ; }
Source:
public void remove ( final org.ovirt.engine.core.common.scheduling.PolicyUnit policyUnit ) { org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.RemoveExternalPolicyUnit , new org.ovirt.engine.core.common.scheduling.parameters.RemoveExternalPolicyUnitParameters ( policyUnit.getId ( ) ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { getRefreshPolicyUnitsEvent ( ) . raise ( this , null ) ; } } ) ; }

Target:
public void remove ( final org.ovirt.engine.core.common.scheduling.PolicyUnit policyUnit ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.RemoveExternalPolicyUnit , new org.ovirt.engine.core.common.scheduling.parameters.RemoveExternalPolicyUnitParameters ( policyUnit.getId ( ) ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { getRefreshPolicyUnitsEvent ( ) . raise ( this , null ) ; } } ) ; }
Source:
public void isTemplateNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String templateName , org.ovirt.engine.core.compat.Guid datacenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.core.common.queries.NameQueryParameters params = new org.ovirt.engine.core.common.queries.NameQueryParameters ( templateName ) ; params.setDatacenterId ( datacenterId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , params , aQuery ) ; }

Target:
public void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name , org.ovirt.engine.core.compat.Guid datacenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.core.common.queries.NameQueryParameters params = new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) ; params.setDatacenterId ( datacenterId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmWithSameNameExist , params , aQuery ) ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaStorageConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > ( ) ; if ( java.lang.Boolean.TRUE.equals ( org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) . getRunAsStateless ( ) ) ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage image : org.ovirt.engine.core.bll.RunVmOnceCommand.getVm ( ) . getDiskList ( ) ) { list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( image.getQuotaId ( ) , null , QuotaConsumptionParameter.QuotaAction.CONSUME , image.getStorageIds ( ) . get ( 0 ) , image.getActualSize ( ) ) ) ; } } return list ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaStorageConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > ( ) ; if ( org.ovirt.engine.core.bll.RunVmOnceCommand.isRunAsStateless ( ) ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage image : org.ovirt.engine.core.bll.RunVmOnceCommand.getVm ( ) . getDiskList ( ) ) { list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( image.getQuotaId ( ) , null , QuotaConsumptionParameter.QuotaAction.CONSUME , image.getStorageIds ( ) . get ( 0 ) , image.getActualSize ( ) ) ) ; } } return list ; }
Source:
protected org.ovirt.engine.api.model.Network lookupClusterNetwork ( org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid id , java.lang.String name , java.util.List < org.ovirt.engine.api.model.Network > networks ) { for ( org.ovirt.engine.api.model.Network network : networks ) { if ( ( ( id != null ) && ( id.equals ( network.getId ( ) ) ) ) || ( ( name != null ) && ( name.equals ( network.getName ( ) ) ) ) ) { return network ; } } return null ; }

Target:
protected org.ovirt.engine.core.common.businessentities.network.Network getClusterNetwork ( org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid id , java.lang.String name ) { for ( org.ovirt.engine.api.restapi.resource.Network entity : getBackendCollection ( org.ovirt.engine.core.common.businessentities.network.Network.class , VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) ) ) { if ( ( ( id != null ) && ( id.equals ( entity.getId ( ) ) ) ) || ( ( name != null ) && ( name.equals ( entity.getName ( ) ) ) ) ) { return entity ; } } return null ; }
Source:
public static void getAAAProfilesList ( 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 ? new java.util.ArrayList < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
private void mockGraphicsDevices ( org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.businessentities.VmDevice graphicsDevice = new org.ovirt.engine.core.common.businessentities.GraphicsDevice ( org.ovirt.engine.core.common.utils.VmDeviceType.SPICE ) ; graphicsDevice.setDeviceId ( Guid.Empty ) ; graphicsDevice.setVmId ( vmId ) ; org.mockito.Mockito.when ( deviceDao.getVmDeviceByVmIdAndType ( vmId , VmDeviceGeneralType.GRAPHICS ) ) . thenReturn ( java.util.Arrays.asList ( graphicsDevice ) ) ; org.mockito.Mockito.doReturn ( deviceDao ) . when ( dbFacade ) . getVmDeviceDao ( ) ; }

Target:
public void initTest ( ) { mockCpuFlagsManagerHandler ( ) ; mockOsRepository ( ) ; org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.dal.dbbroker.DbFacade.class , dbFacade ) ; org.mockito.Mockito.doReturn ( deviceDao ) . when ( dbFacade ) . getVmDeviceDao ( ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.init ( ) ; }
Source:
protected void setUpGetEntityExpectations ( int times , org.ovirt.engine.core.compat.Guid entityId , org.ovirt.engine.core.common.businessentities.Permissions permission ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetPermissionById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { entityId } , permission ) ; } }

Target:
protected void setUpGetEntityExpectations ( int times , org.ovirt.engine.core.compat.Guid entityId , org.ovirt.engine.api.model.Permission permission ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetPermissionById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { entityId } , permission ) ; } }