auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntityStatus ( vds.getDynamicData ( ) , vds.getstatus ( ) ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.SetVdsStatus , new org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters ( getVdsId ( ) , org.ovirt.engine.core.common.businessentities.VDSStatus.Unassigned ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntityStatus ( vds.getDynamicData ( ) , vds.getstatus ( ) ) ; runVdsCommand ( VDSCommandType.SetVdsStatus , new org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters ( getVdsId ( ) , org.ovirt.engine.core.common.businessentities.VDSStatus.Unassigned ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
public static org.ovirt.engine.api.model.Option map ( org.ovirt.engine.core.common.queries.ValueObjectPair entity , org.ovirt.engine.api.model.Option template ) { org.ovirt.engine.api.model.Option model = ( template != null ) ? template : new org.ovirt.engine.api.model.Option ( ) ; model.setName ( ( ( java.lang.String ) ( entity.getKey ( ) ) ) ) ; model.setValue ( ( ( java.lang.String ) ( entity.getValue ( ) ) ) ) ; return model ; }

Target:
public static org.ovirt.engine.api.model.Option map ( java.util.Map.Entry < java.lang.String , java.lang.String > entity , org.ovirt.engine.api.model.Option template ) { org.ovirt.engine.api.model.Option model = ( template != null ) ? template : new org.ovirt.engine.api.model.Option ( ) ; model.setName ( entity.getKey ( ) ) ; model.setValue ( entity.getValue ( ) ) ; return model ; }
Source:
protected void RunCommands ( ) { sortCommands ( ) ; for ( final org.ovirt.engine.core.bll.CommandBase < ? > command : getCommands ( ) ) { if ( command.getReturnValue ( ) . getCanDoAction ( ) ) { org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { executeValidatedCommand ( command ) ; } } ) ; } } }

Target:
protected void runCommands ( ) { sortCommands ( ) ; for ( final org.ovirt.engine.core.bll.CommandBase < ? > command : getCommands ( ) ) { if ( command.getReturnValue ( ) . getCanDoAction ( ) ) { org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { executeValidatedCommand ( command ) ; } } ) ; } } }
Source:
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 ) ; }

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 testExistingPassDiscardFunctionalityIsNotPreservedSdDiscardSupportBreaks ( ) { setSdDiscardSupport ( true , false ) ; createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( false , true ) ; org.junit.Assert.assertFalse ( discardHelper.isExistingPassDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardFunctionality ( 0L , true ) , createLunWithDiscardFunctionality ( 2048L , false ) ) , storageDomain ) ) ; }

Target:
public void testExistingDiscardAfterDeleteFunctionalityPreservedNoDiscardAfterDeleteFunctionality ( ) { storageDomain.setDiscardAfterDelete ( false ) ; org.junit.Assert.assertTrue ( discardHelper.isExistingDiscardAfterDeleteFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardSupport ( 0L ) , createLunWithDiscardSupport ( 0L ) ) , storageDomain ) ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.AffinityLabel label ) { validateParameters ( label , "name" ) ; org.ovirt.engine.api.restapi.resource.Label newLabel = map ( label ) ; org.ovirt.engine.core.common.action.LabelActionParameters params = new org.ovirt.engine.core.common.action.LabelActionParameters ( newLabel ) ; return performCreate ( VdcActionType.AddLabel , params , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetLabelById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.AffinityLabel label ) { validateParameters ( label , "name" ) ; org.ovirt.engine.api.restapi.resource.Label newLabel = map ( label ) ; org.ovirt.engine.core.common.action.LabelActionParameters params = new org.ovirt.engine.core.common.action.LabelActionParameters ( newLabel ) ; return performCreate ( ActionType.AddLabel , params , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetLabelById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }
Source:
public static void removeNetworkFromHostsInDataCenter ( org.ovirt.engine.core.common.businessentities.network.Network network , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.bll.context.CommandContext context ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getInterfaceDao ( ) . getAllInterfacesByLabelForDataCenter ( dataCenterId , network.getLabel ( ) ) ; org.ovirt.engine.core.bll.network.cluster.NetworkHelper.removeNetworkFromHosts ( network , context , nics ) ; }

Target:
public void removeNetworkFromHostsInDataCenter ( org.ovirt.engine.core.common.businessentities.network.Network network , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.bll.context.CommandContext context ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics = interfaceDao.getAllInterfacesByLabelForDataCenter ( dataCenterId , network.getLabel ( ) ) ; removeNetworkFromHosts ( network , context , nics ) ; }
Source:
public void executeCommandWhenFailed ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.DisableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( CLUSTER_ID , HOOK_ID ) ) ) ; setupMocks ( cmd ) ; mockBackend ( cmd , false ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertFalse ( cmd.getReturnValue ( ) . getSucceeded ( ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_DISABLE_FAILED ) ; }

Target:
public void executeCommandWhenFailed ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.DisableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( CLUSTER_ID , HOOK_ID ) ) ) ; setupMocks ( cmd ) ; mockBackendStatusChange ( cmd , false ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertFalse ( cmd.getReturnValue ( ) . getSucceeded ( ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_DISABLE_FAILED ) ; }
Source:
protected void commonInitialize ( ) { priorityUtil = new org.ovirt.engine.ui.uicommonweb.models.vms.PriorityUtil ( getModel ( ) ) ; virtioScsiUtil = new org.ovirt.engine.ui.uicommonweb.models.vms.VirtioScsiUtil ( getModel ( ) ) ; getModel ( ) . getVmId ( ) . setIsAvailable ( false ) ; getModel ( ) . getMigrationPolicies ( ) . setItems ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMigrationPolicies ( org.ovirt.engine.core.compat.Version.getLast ( ) ) ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { boolean ha = getModel ( ) . getIsHighlyAvailable ( ) . getEntity ( ) ; getModel ( ) . getLease ( ) . setIsChangeable ( ha ) ; if ( ! ha ) { getModel ( ) . getLease ( ) . setSelectedItem ( null ) ; } }
Source:
public void getEngineSshPublicKey ( 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.GetEngineSSHPublicKey , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { 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.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }
Source:
public void render ( org.ovirt.engine.ui.userportal.section.main.view.tab.extended.Context context , org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel item , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { sb.append ( templates.vmNameCellItem ( org.ovirt.engine.ui.common.utils.ElementIdUtils.createTableCellElementId ( elementIdPrefix , "name" , context ) , item.getName ( ) ) ) ; java.lang.String description = item.getDescription ( ) ; if ( ( description != null ) && ( ! ( description.isEmpty ( ) ) ) ) { sb.append ( templates.vmDescriptionCellItem ( description ) ) ; } }

Target:
public void render ( org.ovirt.engine.ui.userportal.section.main.view.tab.extended.Context context , org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel item , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb , java.lang.String id ) { sb.append ( org.ovirt.engine.ui.userportal.section.main.view.tab.extended.SideTabExtendedVirtualMachineView.templates.vmNameCellItem ( id , item.getName ( ) ) ) ; java.lang.String description = item.getDescription ( ) ; if ( ( description != null ) && ( ! ( description.isEmpty ( ) ) ) ) { sb.append ( org.ovirt.engine.ui.userportal.section.main.view.tab.extended.SideTabExtendedVirtualMachineView.templates.vmDescriptionCellItem ( description ) ) ; } }
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.roles > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.roles > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }

Target:
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 ) ; }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { if ( ( modelProvider.getModel ( ) . getSelectedItem ( ) ) == null ) { return ; } setupDisks ( modelProvider ) ; }

Target:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { if ( ( modelProvider.getModel ( ) . getSelectedItem ( ) ) == null ) { return ; } @ java.lang.SuppressWarnings ( value = "unchecked" ) java.lang.Iterable < org.ovirt.engine.core.common.businessentities.DiskImage > diskImages = modelProvider.getModel ( ) . getvmBasicDiskListModel ( ) . getItems ( ) ; getView ( ) . editDistItems ( diskImages ) ; }
Source:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { if ( ! ( org.apache.commons.lang.StringUtils.isBlank ( getParameters ( ) . getVm ( ) . getName ( ) ) ) ) { return java.util.Collections.singletonMap ( getParameters ( ) . getVm ( ) . getName ( ) , LockMessagesMatchUtil.VM_NAME ) ; } return null ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { if ( ! ( org.apache.commons.lang.StringUtils.isBlank ( getParameters ( ) . getVm ( ) . getName ( ) ) ) ) { return java.util.Collections.singletonMap ( getParameters ( ) . getVm ( ) . getName ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.VM_NAME , VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ; } return null ; }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { java.lang.String propName = ( ( org.ovirt.engine.core.compat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ; if ( "IsHostAvailable" . equals ( propName ) ) { hostTab.setVisible ( object.getIsHostAvailable ( ) ) ; } else if ( "IsHostTabValid" . equals ( propName ) ) { if ( object.getIsHostTabValid ( ) ) { hostTab.markAsValid ( ) ; } else { hostTab.markAsInvalid ( null ) ; } } }

Target:
protected void setupHostTabAvailability ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { hostTab.setVisible ( model.getIsHostAvailable ( ) ) ; }
Source:
protected boolean disconnectStorage ( ) { return runVdsCommand ( VDSCommandType.DisconnectStorageServer , new org.ovirt.engine.core.common.vdscommands.StorageServerConnectionManagementVDSParameters ( org.ovirt.engine.core.bll.storage.connection.DisconnectStorageServerConnectionCommand.getParameters ( ) . getVdsId ( ) , org.ovirt.engine.core.compat.Guid.Empty , org.ovirt.engine.core.bll.storage.connection.DisconnectStorageServerConnectionCommand.getParameters ( ) . getStorageServerConnection ( ) . getstorage_type ( ) , new java.util.ArrayList ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.StorageServerConnections [ ] { org.ovirt.engine.core.bll.storage.connection.DisconnectStorageServerConnectionCommand.getConnection ( ) } ) ) ) ) . getSucceeded ( ) ; }

Target:
protected boolean disconnectStorage ( ) { return runVdsCommand ( VDSCommandType.DisconnectStorageServer , new org.ovirt.engine.core.common.vdscommands.StorageServerConnectionManagementVDSParameters ( org.ovirt.engine.core.bll.storage.connection.DisconnectStorageServerConnectionCommand.getParameters ( ) . getVdsId ( ) , org.ovirt.engine.core.compat.Guid.Empty , org.ovirt.engine.core.bll.storage.connection.DisconnectStorageServerConnectionCommand.getParameters ( ) . getStorageServerConnection ( ) . getStorageType ( ) , new java.util.ArrayList ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.StorageServerConnections [ ] { org.ovirt.engine.core.bll.storage.connection.DisconnectStorageServerConnectionCommand.getConnection ( ) } ) ) ) ) . getSucceeded ( ) ; }
Source:
public void testAddStoragePoolIsoMap ( ) { dao.save ( newStoragePoolIsoMap ) ; org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap result = dao.get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( newStoragePoolIsoMap.getstorage_id ( ) , newStoragePoolIsoMap.getstorage_pool_id ( ) ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( newStoragePoolIsoMap , result ) ; }

Target:
public void testAddStoragePoolIsoMap ( ) { dao.save ( newStoragePoolIsoMap ) ; org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap result = dao.get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( newStoragePoolIsoMap.getStorageId ( ) , newStoragePoolIsoMap.getStoragePoolId ( ) ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( newStoragePoolIsoMap , result ) ; }
Source:
public void qosCommitmentMissingBondSpeedMode0 ( ) { org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = qosCommitmendMissingBondSpeed ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_MODE_0 ) ; validateAndExpectNoViolations ( helper ) ; }

Target:
private void mockCalculateBaseNicWhenVlanNicIsPassed ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface baseNic , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vlanNic ) { org.mockito.Mockito.when ( calculateBaseNic.getBaseNic ( org.mockito.Matchers.eq ( vlanNic ) ) ) . thenReturn ( baseNic ) ; org.mockito.Mockito.when ( calculateBaseNic.getBaseNic ( org.mockito.Matchers.eq ( vlanNic ) , org.mockito.Matchers.any ( java.util.Map.class ) ) ) . thenReturn ( baseNic ) ; }
Source:
public void testUpdateBrickNetworkId ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity existingBrick = dao.getById ( FixturesTool.GLUSTER_BRICK_UUID1 ) ; org.junit.Assert.assertNotNull ( existingBrick ) ; org.junit.Assert.assertNull ( existingBrick.getNetworkId ( ) ) ; dao.updateBrickNetworkId ( FixturesTool.GLUSTER_BRICK_UUID1 , FixturesTool.NETWORK_ENGINE ) ; existingBrick = dao.getById ( FixturesTool.GLUSTER_BRICK_UUID1 ) ; org.junit.Assert.assertNotNull ( existingBrick ) ; org.junit.Assert.assertEquals ( FixturesTool.NETWORK_ENGINE , existingBrick.getNetworkId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricks = dao.getAllByClusterAndNetworkId ( FixturesTool.GLUSTER_CLUSTER_ID , FixturesTool.NETWORK_ENGINE ) ; org.junit.Assert.assertNotNull ( bricks ) ; }

Target:
public void testUpdateBrickNetworkId ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity existingBrick = dao.getById ( FixturesTool.GLUSTER_BRICK_UUID1 ) ; org.junit.jupiter.api.Assertions.assertNotNull ( existingBrick ) ; org.junit.jupiter.api.Assertions.assertNull ( existingBrick.getNetworkId ( ) ) ; dao.updateBrickNetworkId ( FixturesTool.GLUSTER_BRICK_UUID1 , FixturesTool.NETWORK_ENGINE ) ; existingBrick = dao.getById ( FixturesTool.GLUSTER_BRICK_UUID1 ) ; org.junit.jupiter.api.Assertions.assertNotNull ( existingBrick ) ; org.junit.jupiter.api.Assertions.assertEquals ( FixturesTool.NETWORK_ENGINE , existingBrick.getNetworkId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricks = dao.getAllByClusterAndNetworkId ( FixturesTool.GLUSTER_CLUSTER_ID , FixturesTool.NETWORK_ENGINE ) ; org.junit.jupiter.api.Assertions.assertNotNull ( bricks ) ; }
Source:
public static void setAsyncJob ( org.ovirt.engine.core.bll.job.ExecutionContext executionContext , boolean isAsync ) { if ( executionContext == null ) { return ; } org.ovirt.engine.core.common.job.Job job = executionContext.getJob ( ) ; if ( ( ( executionContext.getExecutionMethod ( ) ) == ( org.ovirt.engine.core.bll.job.ExecutionContext.ExecutionMethod.AsJob ) ) && ( job != null ) ) { job.setIsAsyncJob ( isAsync ) ; } }

Target:
public static void setAsyncJob ( org.ovirt.engine.core.bll.job.ExecutionContext executionContext , boolean isAsync ) { if ( executionContext == null ) { return ; } org.ovirt.engine.core.common.job.Job job = executionContext.getJob ( ) ; if ( ( ( executionContext.getExecutionMethod ( ) ) == ( org.ovirt.engine.core.common.utils.ExecutionMethod.AsJob ) ) && ( job != null ) ) { job.setIsAsyncJob ( isAsync ) ; } }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getVnicProfileDao ( ) ; vnicProfile = new org.ovirt.engine.core.common.businessentities.network.VnicProfile ( ) ; vnicProfile.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vnicProfile.setName ( "new_profile" ) ; vnicProfile.setNetworkId ( FixturesTool.NETWORK_ENGINE ) ; vnicProfile.setPortMirroring ( false ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getVnicProfileDao ( ) ; vnicProfile = new org.ovirt.engine.core.common.businessentities.network.VnicProfile ( ) ; vnicProfile.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vnicProfile.setName ( "new_profile" ) ; vnicProfile.setNetworkId ( FixturesTool.NETWORK_ENGINE ) ; vnicProfile.setNetworkQosId ( FixturesTool.NETWORK_QOS ) ; vnicProfile.setPortMirroring ( false ) ; }
Source:
public com.google.gwt.safehtml.shared.SafeHtml getValue ( org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.VDSGroup , org.ovirt.engine.core.common.businessentities.network.NetworkCluster > object ) { if ( ( object.getSecond ( ) ) != null ) { if ( object.getSecond ( ) . getis_display ( ) ) { return templates.image ( dispalyImage ) ; } return null ; } return templates.image ( com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( "" ) ) ; }

Target:
public com.google.gwt.safehtml.shared.SafeHtml getValue ( org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.VDSGroup , org.ovirt.engine.core.common.businessentities.network.NetworkCluster > object ) { if ( ( object.getSecond ( ) ) != null ) { if ( object.getSecond ( ) . isDisplay ( ) ) { return templates.image ( dispalyImage ) ; } return null ; } return templates.image ( com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( "" ) ) ; }
Source:
public void testRemoveAndSave ( ) { dao.remove ( FixturesTool.POSIX_STORAGE_DOMAIN_ID , FixturesTool.GLUSTER_GEOREP_SESSION_ID2 ) ; org.ovirt.engine.core.common.businessentities.StorageDomainDR result = dao.get ( FixturesTool.POSIX_STORAGE_DOMAIN_ID , FixturesTool.GLUSTER_GEOREP_SESSION_ID2 ) ; org.junit.Assert.assertEquals ( null , result ) ; dao.save ( storageDomainDR ) ; result = dao.get ( FixturesTool.POSIX_STORAGE_DOMAIN_ID , FixturesTool.GLUSTER_GEOREP_SESSION_ID2 ) ; org.junit.Assert.assertEquals ( storageDomainDR , result ) ; }

Target:
public void testRemoveAndSave ( ) { dao.remove ( FixturesTool.POSIX_STORAGE_DOMAIN_ID , FixturesTool.GLUSTER_GEOREP_SESSION_ID2 ) ; org.ovirt.engine.core.common.businessentities.StorageDomainDR result = dao.get ( FixturesTool.POSIX_STORAGE_DOMAIN_ID , FixturesTool.GLUSTER_GEOREP_SESSION_ID2 ) ; org.junit.Assert.assertNull ( result ) ; dao.save ( storageDomainDR ) ; result = dao.get ( FixturesTool.POSIX_STORAGE_DOMAIN_ID , FixturesTool.GLUSTER_GEOREP_SESSION_ID2 ) ; org.junit.Assert.assertEquals ( storageDomainDR , result ) ; }
Source:
public boolean isSysprepUsed ( ) { return ( ( ( getInitializationType ( ) ) == ( InitializationType.Sysprep ) ) && ( org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . get ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) . isWindows ( getVmOsId ( ) ) ) ) && ( ( ( getFloppyPath ( ) ) == null ) || ( "" . equals ( getFloppyPath ( ) ) ) ) ; }

Target:
public boolean isCloudInitUsed ( ) { return ( ( getInitializationType ( ) ) == ( InitializationType.CloudInit ) ) && ( ! ( org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . get ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) . isWindows ( getVmOsId ( ) ) ) ) ; }
Source:
protected org.ovirt.engine.api.model.VM doPopulate ( org.ovirt.engine.api.model.VM model , org.ovirt.engine.api.model.VM entity ) { setPayload ( model ) ; setBallooning ( model ) ; setConsoleDevice ( model ) ; setVirtioScsiController ( model ) ; setCertificateInfo ( model ) ; return model ; }

Target:
protected org.ovirt.engine.api.model.VM doPopulate ( org.ovirt.engine.api.model.VM model , org.ovirt.engine.api.model.VM entity ) { setPayload ( model ) ; setBallooning ( model ) ; setConsoleDevice ( model ) ; setVirtioScsiController ( model ) ; setCertificateInfo ( model ) ; setVmOvfConfiguration ( model , entity ) ; return model ; }
Source:
private void testSetStatusForRequiredNetwork ( org.ovirt.engine.core.common.businessentities.network.Network network , java.lang.String networkNameOnNic ) { testSetStatusForRequiredNetwork ( java.util.Collections.singletonList ( network ) , networkNameOnNic ) ; }

Target:
public void testSetStatusForRequiredNetworkPresentOnHost ( ) { networkCluster.setStatus ( NetworkStatus.OPERATIONAL ) ; underTest.setStatus ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.CLUSTER_ID , java.util.Collections.singletonList ( createNetwork ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_ID1 , org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_NAME1 ) ) ) ; org.mockito.Mockito.verify ( vdsStaticDao ) . checkIfExistsHostThatMissesNetworkInCluster ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.CLUSTER_ID , org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_NAME1 , VDSStatus.Up ) ; org.mockito.Mockito.verify ( networkClusterDao , org.mockito.Mockito.never ( ) ) . updateStatus ( org.mockito.ArgumentMatchers.same ( networkCluster ) ) ; org.junit.Assert.assertThat ( networkCluster.getStatus ( ) , org.hamcrest.Matchers.is ( NetworkStatus.OPERATIONAL ) ) ; }
Source:
private void handleFailure ( org.ovirt.vdsm.jsonrpc.client.utils.ResponseTracking tracking , org.codehaus.jackson.JsonNode id ) { runningCalls.remove ( id ) ; removeRequestFromTracking ( id ) ; tracking.getCall ( ) . addResponse ( org.ovirt.vdsm.jsonrpc.client.utils.JsonUtils.buildFailedResponse ( tracking.getRequest ( ) ) ) ; if ( ( this . failedConnections ) < ( org.ovirt.vdsm.jsonrpc.client.internal.ResponseTracker.MAX_FAILED_CONNECTIONS ) ) { ( this . failedConnections ) ++ ; } else { this . failedConnections = 0 ; tracking.getClient ( ) . close ( ) ; } }

Target:
private void handleFailure ( org.ovirt.vdsm.jsonrpc.client.utils.ResponseTracking tracking , org.codehaus.jackson.JsonNode id ) { runningCalls.remove ( id ) ; removeRequestFromTracking ( id ) ; tracking.getCall ( ) . addResponse ( org.ovirt.vdsm.jsonrpc.client.utils.JsonUtils.buildFailedResponse ( tracking.getRequest ( ) ) ) ; if ( ( this . failedConnections ) < ( org.ovirt.vdsm.jsonrpc.client.internal.ResponseTracker.MAX_FAILED_CONNECTIONS ) ) { ( this . failedConnections ) ++ ; } else { this . failedConnections = 0 ; tracking.getClient ( ) . disconnect ( ) ; } }
Source:
protected org.ovirt.engine.api.model.Certificates mapCollection ( java.util.List < java.security.cert.Certificate > entities ) { org.ovirt.engine.api.model.Certificates collection = new org.ovirt.engine.api.model.Certificates ( ) ; if ( entities != null ) { for ( int i = 0 ; i < ( entities.size ( ) ) ; i ++ ) { java.security.cert.Certificate entity = entities.get ( i ) ; org.ovirt.engine.api.model.Certificate model = populate ( map ( entity ) , entity ) ; model.setId ( java.lang.String.valueOf ( i ) ) ; collection.getCertificates ( ) . add ( model ) ; } } return collection ; }

Target:
protected org.ovirt.engine.api.model.Certificates mapCollection ( java.util.List < org.ovirt.engine.core.common.businessentities.CertificateInfo > entities ) { org.ovirt.engine.api.model.Certificates collection = new org.ovirt.engine.api.model.Certificates ( ) ; if ( entities != null ) { for ( int i = 0 ; i < ( entities.size ( ) ) ; i ++ ) { org.ovirt.engine.core.common.businessentities.CertificateInfo entity = entities.get ( i ) ; org.ovirt.engine.api.model.Certificate model = populate ( map ( entity ) , entity ) ; model.setId ( java.lang.String.valueOf ( i ) ) ; collection.getCertificates ( ) . add ( model ) ; } } return collection ; }
Source:
private void mockCommand ( ) { org.ovirt.engine.core.common.action.ForceSelectSPMParameters params = new org.ovirt.engine.core.common.action.ForceSelectSPMParameters ( storagePoolId , vdsId ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.ForceSelectSPMCommand < org.ovirt.engine.core.common.action.ForceSelectSPMParameters > ( params ) ) ; org.mockito.Mockito.doReturn ( vdsDAOMock ) . when ( command ) . getVdsDAO ( ) ; org.mockito.Mockito.doReturn ( storagePoolDAOMock ) . when ( command ) . getStoragePoolDAO ( ) ; org.mockito.Mockito.doReturn ( asyncTaskDAOMock ) . when ( command ) . getAsyncTaskDao ( ) ; org.mockito.Mockito.doReturn ( vds ) . when ( vdsDAOMock ) . get ( vdsId ) ; }

Target:
private void createVDSandStoragePool ( ) { vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( vdsId ) ; vds.setVdsName ( "TestVDS" ) ; vds.setStoragePoolId ( storagePoolId ) ; vds.setStatus ( VDSStatus.Up ) ; vds.setSpmStatus ( VdsSpmStatus.None ) ; vds.setVdsSpmPriority ( 10 ) ; storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setId ( storagePoolId ) ; }
Source:
public static void getGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }

Target:
public static void getHostsForStorageOperation ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , boolean localFsOnly ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostsForStorageOperation , new org.ovirt.engine.core.common.queries.GetHostsForStorageOperationParameters ( storagePoolId , localFsOnly ) , aQuery ) ; }
Source:
public void updateStorageSelectedItem ( org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType ) { for ( org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel model : getItems ( ) ) { if ( ( ( model.getType ( ) ) == storageType ) && ( ( model.getRole ( ) ) == domainType ) ) { setCurrentStorageItem ( model ) ; break ; } } }

Target:
public void updateCurrentStorageItem ( ) { org.ovirt.engine.core.common.businessentities.StorageDomainType storageDomainType = getAvailableStorageDomainTypeItems ( ) . getSelectedItem ( ) ; org.ovirt.engine.core.common.businessentities.storage.StorageType storageType = getAvailableStorageTypeItems ( ) . getSelectedItem ( ) ; for ( org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel model : getStorageModels ( ) ) { if ( ( ( model.getType ( ) ) == storageType ) && ( ( model.getRole ( ) ) == storageDomainType ) ) { setCurrentStorageItem ( model ) ; break ; } } }
Source:
public void testExecuteQueryCommandSucess ( ) { setup ( org.ovirt.engine.core.bll.network.host.GetTlvsByHostNicIdQueryTest.ExpectedError.SUCCESS ) ; getQuery ( ) . executeQueryCommand ( ) ; java.util.List returnValue = getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ; org.junit.Assert.assertNotNull ( returnValue ) ; org.junit.Assert.assertTrue ( ( ( returnValue.get ( 0 ) ) instanceof org.ovirt.engine.core.common.businessentities.network.Tlv ) ) ; }

Target:
public void testExecuteQueryCommandSucess ( ) { setup ( org.ovirt.engine.core.bll.network.host.GetTlvsByHostNicIdQueryTest.ExpectedError.SUCCESS ) ; getQuery ( ) . executeQueryCommand ( ) ; java.util.List returnValue = getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ; org.junit.jupiter.api.Assertions.assertNotNull ( returnValue ) ; org.junit.jupiter.api.Assertions.assertTrue ( ( ( returnValue.get ( 0 ) ) instanceof org.ovirt.engine.core.common.businessentities.network.Tlv ) ) ; }
Source:
public void onFaliureAlertShown ( ) { mockVdsSingleAgent ( ) ; mockExecutor ( agent1 , false ) ; mockCheckStatus ( "on" ) ; try { command.executeCommand ( ) ; } catch ( org.ovirt.engine.core.common.errors.VdcBLLException exception ) { org.mockito.Mockito.verify ( auditLogDirector , org.mockito.Mockito.times ( 2 ) ) . log ( org.mockito.Matchers.any ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.AuditLogType.class ) ) ; return ; } org.junit.Assert.fail ( ) ; }

Target:
public void onFailureAlertShown ( ) { mockExecutor ( false ) ; try { command.executeCommand ( ) ; org.junit.Assert.fail ( ) ; } catch ( org.ovirt.engine.core.common.errors.VdcBLLException ex ) { org.mockito.Mockito.verify ( auditLogDirector , org.mockito.Mockito.times ( 3 ) ) . log ( org.mockito.Matchers.any ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.AuditLogType.class ) ) ; } }
Source:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID } , null ) ; try { resource.update ( getUpdate ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID } , null ) ; try { resource.update ( getUpdate ( ) ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.Permissions > getAllForEntity ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered , boolean allUsersWithPermission , int appMode ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "id" , id ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) . addValue ( "app_mode" , appMode ) ; java.lang.String functionName = "GetPermissionsByEntityId" ; if ( allUsersWithPermission ) { functionName = "GetAllUsersWithPermissionsOnEntityByEntityId" ; } return getCallsHandler ( ) . executeReadList ( functionName , org.ovirt.engine.core.dao.PermissionDAODbFacadeImpl.PermissionRowMapper.instance , parameterSource ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.Permissions > getAllForEntity ( org.ovirt.engine.core.compat.Guid id , long engineSessionSeqId , boolean isFiltered , boolean allUsersWithPermission , int appMode ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "id" , id ) . addValue ( "engine_session_seq_id" , engineSessionSeqId ) . addValue ( "is_filtered" , isFiltered ) . addValue ( "app_mode" , appMode ) ; java.lang.String functionName = "GetPermissionsByEntityId" ; if ( allUsersWithPermission ) { functionName = "GetAllUsersWithPermissionsOnEntityByEntityId" ; } return getCallsHandler ( ) . executeReadList ( functionName , org.ovirt.engine.core.dao.PermissionDAODbFacadeImpl.PermissionRowMapper.instance , parameterSource ) ; }
Source:
public void provisioningValidated ( ) throws java.lang.Exception { setupVirtMock ( ) ; org.junit.Assert.assertTrue ( command.validate ( ) ) ; org.mockito.Mockito.verify ( validator , org.mockito.Mockito.times ( 1 ) ) . provisioningComputeResourceValid ( org.mockito.ArgumentMatchers.anyBoolean ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.verify ( validator , org.mockito.Mockito.times ( 1 ) ) . provisioningHostGroupValid ( org.mockito.ArgumentMatchers.anyBoolean ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; }

Target:
public void provisioningValidated ( ) throws java.lang.Exception { setupVirtMock ( ) ; org.junit.jupiter.api.Assertions.assertTrue ( command.validate ( ) ) ; org.mockito.Mockito.verify ( validator , org.mockito.Mockito.times ( 1 ) ) . provisioningComputeResourceValid ( org.mockito.ArgumentMatchers.anyBoolean ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.verify ( validator , org.mockito.Mockito.times ( 1 ) ) . provisioningHostGroupValid ( org.mockito.ArgumentMatchers.anyBoolean ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.StorageDomain prepareLocalStorageDomainForElection ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus status , java.lang.String name ) { final org.ovirt.engine.core.common.businessentities.StorageDomain localDomain = createDataStorageDomain ( status , name , LOCAL_SD_ID ) ; localDomain.setStorageType ( StorageType.LOCALFS ) ; org.mockito.Mockito.when ( storageDomainDao.getAllForStoragePool ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( localDomain ) ) ; cmd.setStoragePool ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; return localDomain ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageDomain prepareLocalStorageDomainForElection ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus status ) { final org.ovirt.engine.core.common.businessentities.StorageDomain localDomain = createDataStorageDomain ( status , "local domain name" , LOCAL_SD_ID ) ; localDomain.setStorageType ( StorageType.LOCALFS ) ; org.mockito.Mockito.when ( storageDomainDao.getAllForStoragePool ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( localDomain ) ) ; cmd.setStoragePool ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; return localDomain ; }
Source:
public void onSuccess ( final java.util.List < org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.queries.VdcQueryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase > > operationList , final java.util.List < org.ovirt.engine.core.common.queries.VdcQueryReturnValue > resultObject ) { org.ovirt.engine.ui.frontend.Frontend.logger.finer ( "Succesful returned result from runMultipleQueries!" ) ; org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult ( queryTypeList , queryParamsList , resultObject ) ; callback.executed ( f ) ; org.ovirt.engine.ui.frontend.communication.AsyncOperationCompleteEvent.fire ( this , state ) ; }

Target:
public void onSuccess ( final java.util.List < org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.queries.VdcQueryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase > > operationList , final java.util.List < org.ovirt.engine.core.common.queries.VdcQueryReturnValue > resultObject ) { org.ovirt.engine.ui.frontend.Frontend.logger.finer ( "Succesful returned result from runMultipleQueries!" ) ; org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult ( queryTypeList , queryParamsList , resultObject ) ; callback.executed ( f ) ; fireAsyncQuerySucceededEvent ( state ) ; }
Source:
public void shouldCheckIfClusterCanBeUpgraded ( ) { createCommandWithDefaultCluster ( ) ; cpuExists ( ) ; architectureIsUpdatable ( ) ; cmd.getCluster ( ) . setClusterPolicyId ( ClusterPolicy.UPGRADE_POLICY_GUID ) ; initAndAssertValidation ( true ) ; org.mockito.Mockito.verify ( inClusterUpgradeValidator , org.mockito.Mockito.times ( 1 ) ) . isUpgradePossible ( org.mockito.Matchers.anyList ( ) , org.mockito.Matchers.anyList ( ) ) ; org.mockito.Mockito.verify ( inClusterUpgradeValidator , org.mockito.Mockito.times ( 0 ) ) . isUpgradeDone ( org.mockito.Matchers.anyList ( ) ) ; }

Target:
public void shouldCheckIfClusterCanBeUpgraded ( ) { createCommandWithDefaultCluster ( ) ; cpuExists ( ) ; architectureIsUpdatable ( ) ; cmd.getCluster ( ) . setClusterPolicyId ( ClusterPolicy.UPGRADE_POLICY_GUID ) ; initAndAssertValidation ( true ) ; org.mockito.Mockito.verify ( inClusterUpgradeValidator , org.mockito.Mockito.times ( 1 ) ) . isUpgradePossible ( org.mockito.ArgumentMatchers.anyList ( ) , org.mockito.ArgumentMatchers.anyList ( ) ) ; org.mockito.Mockito.verify ( inClusterUpgradeValidator , org.mockito.Mockito.times ( 0 ) ) . isUpgradeDone ( org.mockito.ArgumentMatchers.anyList ( ) ) ; }
Source:
private java.lang.String getMessageToLog ( java.lang.String loggerString , org.ovirt.engine.core.common.businessentities.AuditLog auditLog ) { java.lang.String logMessage ; if ( loggerString.isEmpty ( ) ) { logMessage = auditLog.toStringForLogging ( ) ; } else { logMessage = java.text.MessageFormat.format ( loggerString.replaceAll ( "'" , "" ) , auditLog.getmessage ( ) ) ; } return logMessage ; }

Target:
private static java.lang.String getMessageToLog ( java.lang.String loggerString , org.ovirt.engine.core.common.businessentities.AuditLog auditLog ) { if ( loggerString.isEmpty ( ) ) { return auditLog.toStringForLogging ( ) ; } else { return java.text.MessageFormat.format ( loggerString , auditLog.getMessage ( ) ) ; } }
Source:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommandTest.CLUSTER_ID , org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommandTest.HOOK_ID ) ) ) ; setupMocks ( ) ; mockConfig ( ) ; mockBackend ( true ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_ENABLE ) ; }

Target:
public void executeCommandWhenFailed ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( CLUSTER_ID , HOOK_ID ) ) ) ; setupMocks ( cmd ) ; mockBackend ( cmd , false ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.never ( ) ) . addServerHookInDb ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook.class ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_ENABLE_FAILED ) ; }
Source:
public static void getMaxNumOfCPUsPerSocket ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfCpuPerSocket ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public static void isSoundcardEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ( ( ( java.util.List < java.lang.String > ) ( source ) ) . size ( ) ) > 0 ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetSoundDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public void update ( int index , java.lang.Object model , java.lang.Boolean value ) { ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData ) ( model ) ) . getCollapseSnapshots ( ) . setEntity ( value ) ; customSelectionCellFormatType.setEnabledWithToolTip ( value , constants.importAllocationModifiedCollapse ( ) ) ; diskTable.asEditor ( ) . edit ( importModel.getImportDiskListModel ( ) ) ; }

Target:
public void update ( int index , java.lang.Object model , java.lang.Boolean value ) { ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData ) ( model ) ) . getCollapseSnapshots ( ) . setEntity ( value ) ; customSelectionCellFormatType.setEnabled ( value ) ; diskTable.asEditor ( ) . edit ( importModel.getImportDiskListModel ( ) ) ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; return getClusterByServiceList ( list , supportsVirtService , supportsGlusterService ) ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return source ; }