auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void printUsage ( org.ovirt.engine.core.uutils.cli.parser.ArgumentsParser parser ) { java.lang.System.out.format ( "Usage: %s" , parser.getUsage ( ) ) ; }

Target:
public void parseArguments ( java.util.List < java.lang.String > args ) throws java.lang.Exception { final java.util.Map < java.lang.String , java.lang.String > substitutions = new java.util.HashMap < > ( ) ; substitutions.put ( "@PROGRAM_NAME@" , ( ( java.lang.String ) ( context.get ( org.ovirt.engine.exttool.logger.PROGRAM_NAME ) ) ) ) ; args.remove ( 0 ) ; java.util.Properties props = new java.util.Properties ( ) ; try ( java.io.InputStream in = org.ovirt.engine.exttool.logger.LoggerServiceImpl.class . getResourceAsStream ( "arguments.properties" ) ; java.io.Reader reader = new java.io.InputStreamReader ( in ) ) { props.load ( reader ) ; } org.ovirt.engine.core.uutils.cli.parser.ArgumentsParser parser = new org.ovirt.engine.core.uutils.cli.parser.ArgumentsParser ( props , "module" ) ; parser.getSubstitutions ( ) . putAll ( substitutions ) ; parser.parse ( args ) ; java.util.Map < java.lang.String , java.lang.Object > moduleArgs = parser.getParsedArgs ( ) ; if ( ( ( java.lang.Boolean ) ( moduleArgs.get ( "help" ) ) ) ) { java.lang.System.out.format ( "Usage: %s" , parser.getUsage ( ) ) ; throw new org.ovirt.engine.exttool.core.ExitException ( "Help" , 0 ) ; } if ( ! ( parser.getErrors ( ) . isEmpty ( ) ) ) { for ( java.lang.Throwable t : parser.getErrors ( ) ) { java.lang.System.err.format ( "FATAL: %s%n" , t.getMessage ( ) ) ; } throw new org.ovirt.engine.exttool.core.ExitException ( "Parsing error" , 1 ) ; } if ( ( args.size ( ) ) < 1 ) { java.lang.System.err.println ( "Action not provided" ) ; throw new org.ovirt.engine.exttool.core.ExitException ( "Action not provided" , 1 ) ; } try { action = org.ovirt.engine.exttool.logger.LoggerServiceImpl.Action.valueOf ( args.get ( 0 ) . toUpperCase ( ) . replace ( "-" , "_" ) ) ; } catch ( java.lang.IllegalArgumentException e ) { java.lang.System.err.printf ( "Invalid action '%s'%n" , args.get ( 0 ) ) ; throw new org.ovirt.engine.exttool.core.ExitException ( "Invalid action" , 1 ) ; } argMap = action.parse ( substitutions , props , args ) ; }
Source:
public void canDoActionSameSourceAndDest ( ) throws java.lang.Exception { createParameters ( srcStorageId , srcStorageId ) ; org.ovirt.engine.core.common.businessentities.StorageDomain srcStorageDomain = initStorageDomain ( srcStorageId ) ; srcStorageDomain.setStatus ( StorageDomainStatus.Active ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_SOURCE_AND_TARGET_SAME.name ( ) ) ) ; }

Target:
public void canDoActionSameSourceAndDest ( ) throws java.lang.Exception { createParameters ( srcStorageId , srcStorageId ) ; org.ovirt.engine.core.common.businessentities.StorageDomain srcStorageDomain = initStorageDomain ( srcStorageId ) ; srcStorageDomain.setStatus ( StorageDomainStatus.Active ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_SOURCE_AND_TARGET_SAME.name ( ) ) ) ; }
Source:
public void canDoActionNotEnoughSpace ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithoutSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }

Target:
public void canDoActionTemplateImageIsLocked ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Copy , new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initTemplateDiskImage ( ) ; command.getImage ( ) . setImageStatus ( ImageStatus.LOCKED ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ) . when ( command ) . getTemplateForImage ( ) ; command.defineVmTemplate ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.VM_TEMPLATE_IMAGE_IS_LOCKED.toString ( ) ) ) ; }
Source:
private void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveUser , org.ovirt.engine.core.common.action.IdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveUser , org.ovirt.engine.core.common.action.IdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
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.storage.RepoImage > repoList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.RepoImage > ) ( source ) ) ; java.util.ArrayList < java.lang.String > fileNameList = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.RepoImage repoImage : repoList ) { fileNameList.add ( repoImage.getRepoImageId ( ) ) ; } java.util.Collections.sort ( fileNameList , java.lang.String.CASE_INSENSITIVE_ORDER ) ; return fileNameList ; } return new java.util.ArrayList < java.lang.String > ( ) ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.Set < org.ovirt.engine.core.common.businessentities.AdditionalFeature > ) ( source ) ) : new java.util.HashSet < org.ovirt.engine.core.common.businessentities.AdditionalFeature > ( ) ; }
Source:
public void testListCrash ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpQueryExpectations ( org.ovirt.engine.api.restapi.resource.aaa.BackendUsersResourceTest.QUERY , t ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.aaa.BACKEND_FAILED_SERVER_LOCALE , t ) ; } }

Target:
public void testListCrash ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpQueryExpectations ( org.ovirt.engine.api.restapi.resource.aaa.BackendUsersResourceTest.QUERY , t ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.aaa.BACKEND_FAILED_SERVER_LOCALE , t ) ; } }
Source:
protected java.lang.Object runQuery ( org.ovirt.engine.core.common.queries.VdcQueryType queryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase queryParams , java.lang.String sessionId ) { initQueryParams ( queryParams , sessionId ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue result = backend.runQuery ( queryType , queryParams ) ; return result.getSucceeded ( ) ? result.getReturnValue ( ) : null ; }

Target:
protected java.lang.Object runPublicQuery ( org.ovirt.engine.core.common.queries.VdcQueryType queryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase queryParams , java.lang.String sessionId ) { initQueryParams ( queryParams , sessionId ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue result = backend.runPublicQuery ( queryType , queryParams ) ; return ( result != null ) && ( result.getSucceeded ( ) ) ? result.getReturnValue ( ) : null ; }
Source:
public void testBasicConstructors ( ) { org.ovirt.engine.core.compat.TimeSpan span = new org.ovirt.engine.core.compat.TimeSpan ( 10 , 10 , 10 ) ; org.junit.Assert.assertEquals ( 10 , span.Hours ) ; org.junit.Assert.assertEquals ( 10 , span.Minutes ) ; org.junit.Assert.assertEquals ( 10 , span.Seconds ) ; org.junit.Assert.assertEquals ( 0 , span.Days ) ; org.junit.Assert.assertEquals ( 0 , span.Milliseconds ) ; }

Target:
public void testBasicConstructors ( ) { org.ovirt.engine.core.compat.TimeSpan span = new org.ovirt.engine.core.compat.TimeSpan ( 10 , 10 , 10 ) ; org.junit.jupiter.api.Assertions.assertEquals ( 10 , span.Hours ) ; org.junit.jupiter.api.Assertions.assertEquals ( 10 , span.Minutes ) ; org.junit.jupiter.api.Assertions.assertEquals ( 10 , span.Seconds ) ; org.junit.jupiter.api.Assertions.assertEquals ( 0 , span.Days ) ; org.junit.jupiter.api.Assertions.assertEquals ( 0 , span.Milliseconds ) ; }
Source:
public void testUpdateGlusterHookChecksum ( ) { dao.updateGlusterServerHookChecksum ( FixturesTool.HOOK_ID , org.ovirt.engine.core.dao.gluster.GlusterHooksDaoTest.SERVER_ID , org.ovirt.engine.core.dao.gluster.GlusterHooksDaoTest.CHECKSUM ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook serverhook = dao.getGlusterServerHook ( FixturesTool.HOOK_ID , org.ovirt.engine.core.dao.gluster.GlusterHooksDaoTest.SERVER_ID ) ; org.junit.Assert.assertNotNull ( serverhook ) ; org.junit.Assert.assertEquals ( GlusterHookStatus.ENABLED , serverhook.getStatus ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.gluster.GlusterHooksDaoTest.CHECKSUM , serverhook.getChecksum ( ) ) ; }

Target:
public void testUpdateGlusterHookChecksum ( ) { dao.updateGlusterServerHookChecksum ( FixturesTool.HOOK_ID , FixturesTool.VDS_GLUSTER_SERVER2 , org.ovirt.engine.core.dao.gluster.GlusterHooksDaoTest.CHECKSUM ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook serverhook = dao.getGlusterServerHook ( FixturesTool.HOOK_ID , FixturesTool.VDS_GLUSTER_SERVER2 ) ; org.junit.Assert.assertNotNull ( serverhook ) ; org.junit.Assert.assertEquals ( GlusterHookStatus.ENABLED , serverhook.getStatus ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.gluster.GlusterHooksDaoTest.CHECKSUM , serverhook.getChecksum ( ) ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap runInTransaction ( ) { org.ovirt.engine.core.bll.context.CompensationContext context = getCompensationContext ( ) ; context.snapshotEntityStatus ( map , map.getstatus ( ) ) ; updateStatus ( map , status ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { for ( org.ovirt.engine.core.common.businessentities.StorageDomain domainToUpdate : storageDomainsToUpdate ) { org.ovirt.engine.core.bll.context.CompensationContext context = getCompensationContext ( ) ; context.snapshotEntity ( domainToUpdate.getStorageDynamicData ( ) ) ; getStorageDomainDynamicDao ( ) . update ( domainToUpdate.getStorageDynamicData ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; } return null ; }
Source:
private static int getFirstImage ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > images , org.ovirt.engine.core.common.businessentities.DiskImage curr ) { for ( int i = 0 ; i < ( images.size ( ) ) ; i ++ ) { if ( curr.getParentId ( ) . equals ( images.get ( i ) . getImageId ( ) ) ) { return i ; } } return - 1 ; }

Target:
private void generateNewDiskId ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > diskList , org.ovirt.engine.core.common.businessentities.DiskImage disk ) { org.ovirt.engine.core.compat.Guid newGuidForDisk = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; newDiskIdForDisk.put ( newGuidForDisk , org.ovirt.engine.core.common.businessentities.DiskImage.copyOf ( disk ) ) ; disk.setId ( newGuidForDisk ) ; disk.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : diskList ) { diskImage.setId ( disk.getId ( ) ) ; } }
Source:
private org.ovirt.engine.core.common.vdscommands.GetVmsFromExternalProviderParameters buildGetRemoteVmsInfoParameters ( ) { return new org.ovirt.engine.core.common.vdscommands.GetVmsFromExternalProviderParameters ( getProxyHostId ( ) , org.ovirt.engine.core.bll.GetVmsFromExternalProviderQuery.getParameters ( ) . getUrl ( ) , org.ovirt.engine.core.bll.GetVmsFromExternalProviderQuery.getParameters ( ) . getUsername ( ) , org.ovirt.engine.core.bll.GetVmsFromExternalProviderQuery.getParameters ( ) . getPassword ( ) ) ; }

Target:
private org.ovirt.engine.core.common.vdscommands.GetVmsFromExternalProviderParameters buildGetRemoteVmsInfoParameters ( ) { return new org.ovirt.engine.core.common.vdscommands.GetVmsFromExternalProviderParameters ( getProxyHostId ( ) , org.ovirt.engine.core.bll.GetVmsFromExternalProviderQuery.getParameters ( ) . getUrl ( ) , org.ovirt.engine.core.bll.GetVmsFromExternalProviderQuery.getParameters ( ) . getUsername ( ) , org.ovirt.engine.core.bll.GetVmsFromExternalProviderQuery.getParameters ( ) . getPassword ( ) , org.ovirt.engine.core.bll.GetVmsFromExternalProviderQuery.getParameters ( ) . getOriginType ( ) ) ; }
Source:
protected javax.ws.rs.core.UriInfo setUpActionExpectations ( org.ovirt.engine.core.common.action.VdcActionType task , java.lang.Class < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > clz , java.lang.String [ ] names , java.lang.Object [ ] values , boolean canDo , boolean success , java.lang.Object taskReturn , java.lang.String baseUri , boolean replay ) { return setUpActionExpectations ( task , clz , names , values , canDo , success , taskReturn , null , null , null , null , baseUri , replay ) ; }

Target:
protected javax.ws.rs.core.UriInfo setUpActionExpectations ( org.ovirt.engine.core.common.action.VdcActionType task , java.lang.Class < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > clz , java.lang.String [ ] names , java.lang.Object [ ] values , boolean canDo , boolean success , java.lang.Object taskReturn , java.lang.String baseUri , boolean replay ) { return setUpActionExpectations ( task , clz , names , values , canDo , success , taskReturn , null , null , null , null , baseUri , replay , org.ovirt.engine.api.restapi.resource.AbstractBackendBaseTest.CANT_DO ) ; }
Source:
public void canDoActionSucceedsWhenHasPeersThrowsException ( ) throws java.lang.Exception { setupGlusterMock ( true , new org.ovirt.engine.core.common.businessentities.VDS ( ) , true ) ; org.mockito.Mockito.when ( glusterUtil.getPeers ( org.mockito.Matchers.any ( org.ovirt.engine.core.bll.utils.EngineSSHClient.class ) ) ) . thenThrow ( new java.lang.RuntimeException ( ) ) ; org.junit.Assert.assertTrue ( commandMock.canDoAction ( ) ) ; }

Target:
public void validateSucceedsWhenHasPeersThrowsException ( ) throws java.lang.Exception { setupGlusterMock ( true , new org.ovirt.engine.core.common.businessentities.VDS ( ) , true ) ; org.mockito.Mockito.when ( glusterUtil.getPeers ( org.mockito.Matchers.any ( org.ovirt.engine.core.bll.utils.EngineSSHClient.class ) ) ) . thenThrow ( new java.lang.RuntimeException ( ) ) ; org.junit.Assert.assertTrue ( commandMock.validate ( ) ) ; }
Source:
protected void onReset ( ) { super . onReset ( ) ; setSubTabPanelVisible ( false ) ; getModel ( ) . refreshReportModel ( ) ; }

Target:
protected void onReset ( ) { super . onReset ( ) ; if ( ! ( hasReportsModelRefreshEvent ( ) ) ) { org.ovirt.engine.ui.webadmin.section.main.presenter.tab.MainTabReportsPresenter.reportsWebappDeployed = false ; getModel ( ) . getReportModelRefreshEvent ( ) . addListener ( new org.ovirt.engine.ui.webadmin.section.main.presenter.tab.MainTabReportsPresenter.ReportsModelRefreshEvent ( ) ) ; } setSubTabPanelVisible ( false ) ; getModel ( ) . refreshReportModel ( ) ; }
Source:
public static org.ovirt.engine.core.common.utils.VmDeviceType getoVirtDevice ( int resourceType ) { for ( org.ovirt.engine.core.common.utils.VmDeviceType deviceType : org.ovirt.engine.core.common.utils.VmDeviceType.values ( ) ) { if ( ( ( deviceType.ovfResourceType ) != null ) && ( ( java.lang.Integer.valueOf ( deviceType.ovfResourceType ) ) == resourceType ) ) { return deviceType ; } } return org.ovirt.engine.core.common.utils.VmDeviceType.UNKNOWN ; }

Target:
public static org.ovirt.engine.core.common.utils.VmDeviceType getoVirtDevice ( int resourceType ) { for ( org.ovirt.engine.core.common.utils.VmDeviceType deviceType : org.ovirt.engine.core.common.utils.VmDeviceType.values ( ) ) { if ( ( ( deviceType.ovfResourceType ) != null ) && ( ( java.lang.Integer.parseInt ( deviceType.ovfResourceType ) ) == resourceType ) ) { return deviceType ; } } return org.ovirt.engine.core.common.utils.VmDeviceType.UNKNOWN ; }
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 ( ) { runVdsCommand ( VDSCommandType.SetVdsStatus , new org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters ( getVdsId ( ) , org.ovirt.engine.core.common.businessentities.VDSStatus.Unassigned ) ) ; return null ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VM getVmFromConfiguration ( ) { org.ovirt.engine.core.common.businessentities.VM result = null ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryReturnValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshot.getId ( ) ) ) ; if ( queryReturnValue.getSucceeded ( ) ) { result = queryReturnValue.getReturnValue ( ) ; } return result ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VM getVmFromConfiguration ( ) { org.ovirt.engine.core.common.businessentities.VM result = null ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryReturnValue = runInternalQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshot.getId ( ) ) ) ; if ( queryReturnValue.getSucceeded ( ) ) { result = queryReturnValue.getReturnValue ( ) ; } return result ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc hotunplugDisk ( org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct info ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.hotunplugDisk ( info.getInnerMap ( ) ) ; 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 ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterHookRemove ( java.lang.String glusterCommand , java.lang.String stage , java.lang.String hookName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterHookRemove ( glusterCommand , stage , hookName ) ; 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:
private void assertCorrectResultForTemplate ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > result ) { assertNotNull ( result ) ; assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : result ) { assertEquals ( org.ovirt.engine.core.dao.network.VmNetworkInterfaceDaoTest.TEMPLATE_ID , iface.getVmTemplateId ( ) ) ; } }

Target:
private void assertCorrectResultForTemplate ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > result ) { org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : result ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.network.VmNetworkInterfaceDaoTest.TEMPLATE_ID , iface.getVmTemplateId ( ) ) ; } }
Source:
protected boolean isImageNotLocked ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) ; if ( ( diskImage.getImageStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.ImageStatus.LOCKED ) ) { if ( ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getOperation ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.ImageOperation.Move ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_DISKS_LOCKED , java.lang.String.format ( "$%1$s %2$s" , "diskAliases" , diskImage.getDiskAlias ( ) ) ) ; } else { return failCanDoAction ( VdcBllMessages.VM_TEMPLATE_IMAGE_IS_LOCKED ) ; } } return true ; }

Target:
protected boolean isImageNotLocked ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) ; if ( ( diskImage.getImageStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.ImageStatus.LOCKED ) ) { if ( ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getOperation ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.ImageOperation.Move ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_DISKS_LOCKED , java.lang.String.format ( "$%1$s %2$s" , "diskAliases" , diskImage.getDiskAlias ( ) ) ) ; } else { return failCanDoAction ( EngineMessage.VM_TEMPLATE_IMAGE_IS_LOCKED ) ; } } return true ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.bll.aaa.RemoveGroupCommand.getParameters ( ) . getId ( ) ; if ( isLastSuperUserGroup ( id ) ) { addCanDoActionMessage ( VdcBllMessages.ERROR_CANNOT_REMOVE_LAST_SUPER_USER_ROLE ) ; return false ; } if ( MultiLevelAdministrationHandler.EVERYONE_OBJECT_ID.equals ( id ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_REMOVE_BUILTIN_GROUP_EVERYONE ) ; return false ; } return true ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.bll.aaa.RemoveGroupCommand.getParameters ( ) . getId ( ) ; if ( isLastSuperUserGroup ( id ) ) { addCanDoActionMessage ( EngineMessage.ERROR_CANNOT_REMOVE_LAST_SUPER_USER_ROLE ) ; return false ; } if ( MultiLevelAdministrationHandler.EVERYONE_OBJECT_ID.equals ( id ) ) { addCanDoActionMessage ( EngineMessage.ACTION_TYPE_FAILED_CANNOT_REMOVE_BUILTIN_GROUP_EVERYONE ) ; return false ; } return true ; }
Source:
protected boolean isBalloonEnabled ( ) { java.lang.Boolean balloonEnabled = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . isBalloonEnabled ( ) ; return balloonEnabled != null ? balloonEnabled : osRepository.isBalloonEnabled ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getOsId ( ) , org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) ) ; }

Target:
protected boolean isSoundDeviceEnabled ( ) { java.lang.Boolean soundDeviceEnabled = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . isSoundDeviceEnabled ( ) ; return soundDeviceEnabled != null ? soundDeviceEnabled : osRepository.isSoundDeviceEnabled ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getOsId ( ) , org.ovirt.engine.core.bll.AddVmCommand.getEffectiveCompatibilityVersion ( ) ) ; }
Source:
public void refuseBalloonOnPPC ( ) { final org.ovirt.engine.core.bll.exportimport.ImportVmCommand < org.ovirt.engine.core.common.action.ImportVmParameters > cmd = setupCanImportPpcTest ( ) ; addBalloonToVm ( cmd.getVmFromExportDomain ( null ) ) ; org.mockito.Mockito.when ( osRepository.isBalloonEnabled ( cmd.getParameters ( ) . getVm ( ) . getVmOsId ( ) , cmd.getCluster ( ) . getCompatibilityVersion ( ) ) ) . thenReturn ( false ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.BALLOON_REQUESTED_ON_NOT_SUPPORTED_ARCH.toString ( ) ) ) ; }

Target:
private void setupCanImportPpcTest ( ) { setupDiskSpaceTest ( ) ; cmd.getParameters ( ) . getVm ( ) . setClusterArch ( ArchitectureType.ppc64 ) ; org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setArchitecture ( ArchitectureType.ppc64 ) ; cluster.setCompatibilityVersion ( org.ovirt.engine.core.compat.Version.getLast ( ) ) ; org.mockito.Mockito.doReturn ( cluster ) . when ( cmd ) . getCluster ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateImages ( org.mockito.Matchers.anyMapOf ( org.ovirt.engine.core.compat.Guid.class , org.ovirt.engine.core.common.businessentities.StorageDomain.class ) ) ; }
Source:
public boolean match ( org.ovirt.engine.core.common.businessentities.DbUser source ) { return ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( source.getDomain ( ) , target.getDomain ( ) ) ) && ( ( ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( target.getLoginName ( ) ) ) || ( "*" . equals ( target.getLoginName ( ) ) ) ) || ( source.getLoginName ( ) . toLowerCase ( ) . startsWith ( target.getLoginName ( ) ) ) ) ; }

Target:
public boolean match ( org.ovirt.engine.core.common.businessentities.aaa.DbUser source ) { return ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( source.getDomain ( ) , target.getDomain ( ) ) ) && ( ( ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( target.getLoginName ( ) ) ) || ( "*" . equals ( target.getLoginName ( ) ) ) ) || ( source.getLoginName ( ) . toLowerCase ( ) . startsWith ( target.getLoginName ( ) ) ) ) ; }
Source:
protected boolean validateSpaceRequirements ( ) { fetchVmDisksFromDb ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList = org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getDiskList ( ) ; org.ovirt.engine.core.bll.validator.MultipleStorageDomainsValidator msdValidator = createMultipleStorageDomainsValidator ( disksList ) ; return validate ( msdValidator.allDomainsHaveSpaceForNewDisks ( disksList ) ) ; }

Target:
protected boolean validateSpaceRequirements ( ) { fetchVmDisksFromDb ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList = org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getDiskList ( ) ; org.ovirt.engine.core.bll.validator.MultipleStorageDomainsValidator msdValidator = createMultipleStorageDomainsValidator ( disksList ) ; return ( validate ( msdValidator.allDomainsHaveSpaceForNewDisks ( disksList ) ) ) && ( validate ( msdValidator.allDomainsWithinThresholds ( ) ) ) ; }
Source:
private java.util.List < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > getStorageQuotaListParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : getParameters ( ) . getVmTemplate ( ) . getDiskList ( ) ) { list.add ( new org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter ( disk.getQuotaId ( ) , imageToDestinationDomainMap.get ( disk.getId ( ) ) , disk.getSizeInGigabytes ( ) ) ) ; } 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 > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : getParameters ( ) . getVmTemplate ( ) . getDiskList ( ) ) { list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( disk.getQuotaId ( ) , null , QuotaConsumptionParameter.QuotaAction.CONSUME , imageToDestinationDomainMap.get ( disk.getId ( ) ) , ( ( double ) ( disk.getSizeInGigabytes ( ) ) ) ) ) ; } return list ; }
Source:
private void verifyVersionEqual ( java.lang.Object returnValue , int major , int minor , int build ) { org.ovirt.engine.core.compat.Version version = ( ( org.ovirt.engine.core.compat.Version ) ( returnValue ) ) ; org.junit.Assert.assertEquals ( version.getMajor ( ) , major ) ; org.junit.Assert.assertEquals ( version.getMinor ( ) , minor ) ; org.junit.Assert.assertEquals ( version.getBuild ( ) , build ) ; org.junit.Assert.assertEquals ( 0 , version.getRevision ( ) ) ; }

Target:
private void verifyVersionEqual ( java.lang.Object returnValue , int major , int minor , int build ) { org.ovirt.engine.core.compat.Version version = ( ( org.ovirt.engine.core.compat.Version ) ( returnValue ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( version.getMajor ( ) , major ) ; org.junit.jupiter.api.Assertions.assertEquals ( version.getMinor ( ) , minor ) ; org.junit.jupiter.api.Assertions.assertEquals ( version.getBuild ( ) , build ) ; org.junit.jupiter.api.Assertions.assertEquals ( 0 , version.getRevision ( ) ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { hostsModel.stopProgress ( ) ; boolean isAllCanDoPassed = true ; for ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase : result.getReturnValue ( ) ) { isAllCanDoPassed = isAllCanDoPassed && ( returnValueBase.getCanDoAction ( ) ) ; if ( ! isAllCanDoPassed ) { break ; } } if ( isAllCanDoPassed ) { updateAlerts ( ) ; cancel ( ) ; } }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ManageGlusterSwiftModel innerGlusterSwiftModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ManageGlusterSwiftModel ) ( result.getState ( ) ) ) ; innerGlusterSwiftModel.stopProgress ( ) ; for ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase : result.getReturnValue ( ) ) { } cancel ( ) ; updateGlusterDetails ( ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.StorageDomain mockGetExistingDomain ( boolean answerWithDomain ) { org.ovirt.engine.core.common.businessentities.StorageDomain sd = null ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = java.util.Collections.emptyList ( ) ; if ( answerWithDomain ) { sd = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; sd.getStorageStaticData ( ) . setConnection ( new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ) ; domains = java.util.Collections.singletonList ( sd ) ; } org.mockito.Mockito.doReturn ( createQueryReturnValueWith ( domains ) ) . when ( backend ) . runInternalQuery ( org.mockito.ArgumentMatchers.eq ( VdcQueryType.GetExistingStorageDomainList ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class ) ) ; return sd ; }

Target:
protected org.ovirt.engine.core.common.businessentities.StorageDomain mockGetExistingDomain ( boolean answerWithDomain ) { org.ovirt.engine.core.common.businessentities.StorageDomain sd = null ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = java.util.Collections.emptyList ( ) ; if ( answerWithDomain ) { sd = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; sd.getStorageStaticData ( ) . setConnection ( new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ) ; domains = java.util.Collections.singletonList ( sd ) ; } org.mockito.Mockito.doReturn ( createQueryReturnValueWith ( domains ) ) . when ( backend ) . runInternalQuery ( org.mockito.ArgumentMatchers.eq ( QueryType.GetExistingStorageDomainList ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class ) ) ; return sd ; }
Source:
protected boolean canDoAction ( ) { if ( ( ( org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommand.getParameters ( ) . getClusterId ( ) ) == null ) || ( ( org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommand.getVdsGroup ( ) ) == null ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_IS_NOT_VALID ) ; return false ; } if ( ! ( super . canDoAction ( ) ) ) { return false ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ( ( org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommand.getParameters ( ) . getClusterId ( ) ) == null ) || ( ( org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommand.getVdsGroup ( ) ) == null ) ) { addCanDoActionMessage ( EngineMessage.ACTION_TYPE_FAILED_CLUSTER_IS_NOT_VALID ) ; return false ; } if ( ! ( super . canDoAction ( ) ) ) { return false ; } return true ; }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.GetVmByVmIdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { NON_EXISTANT_GUID } , null ) ; control.replay ( ) ; try { collection.remove ( org.ovirt.engine.api.restapi.resource.NON_EXISTANT_GUID.toString ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { NON_EXISTANT_GUID } , null ) ; control.replay ( ) ; try { collection.remove ( org.ovirt.engine.api.restapi.resource.NON_EXISTANT_GUID.toString ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
public void getVmsFromExternalServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.compat.Guid vdsId , java.lang.String url , java.lang.String username , java.lang.String password , org.ovirt.engine.core.common.businessentities.OriginType originType ) { 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.GetVmsFromExternalProvider , new org.ovirt.engine.core.common.queries.GetVmsFromExternalProviderQueryParameters ( url , username , password , originType , vdsId , dataCenterId ) , aQuery ) ; }

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:
private static void handleErrorLog ( org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.common.businessentities.ImageFileType imageType ) { java.util.List < org.ovirt.engine.core.common.businessentities.RepoImage > tempProblematicRepoFileList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.RepoImage > ( ) ; org.ovirt.engine.core.common.businessentities.RepoImage repoImage = new org.ovirt.engine.core.common.businessentities.RepoImage ( ) ; repoImage.setStoragePoolId ( storagePoolId ) ; repoImage.setRepoDomainId ( storageDomainId ) ; repoImage.setFileType ( imageType ) ; tempProblematicRepoFileList.add ( repoImage ) ; org.ovirt.engine.core.bll.IsoDomainListSyncronizer.handleErrorLog ( tempProblematicRepoFileList ) ; }

Target:
private static void handleErrorLog ( org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.common.businessentities.storage.ImageFileType imageType ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > tempProblematicRepoFileList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.RepoImage > ( ) ; org.ovirt.engine.core.common.businessentities.storage.RepoImage repoImage = new org.ovirt.engine.core.common.businessentities.storage.RepoImage ( ) ; repoImage.setStoragePoolId ( storagePoolId ) ; repoImage.setRepoDomainId ( storageDomainId ) ; repoImage.setFileType ( imageType ) ; tempProblematicRepoFileList.add ( repoImage ) ; org.ovirt.engine.core.bll.IsoDomainListSyncronizer.handleErrorLog ( tempProblematicRepoFileList ) ; }
Source:
protected void onLogin ( final org.ovirt.engine.ui.uicommonweb.models.LoginModel loginModel ) { org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . init ( ) ; org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . getReportsInitEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { performLogin ( loginModel ) ; } } ) ; }

Target:
protected void onLogin ( final org.ovirt.engine.ui.uicommonweb.models.LoginModel loginModel ) { org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . init ( ) ; org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . getReportsInitEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { updateReportsAvailability ( ) ; } } ) ; performLogin ( loginModel ) ; }
Source:
public void getVmNullId ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.VM v = null ; b.setVm ( v ) ; b.setVmId ( null ) ; final org.ovirt.engine.core.common.businessentities.VM vm = b.getVm ( ) ; org.junit.Assert.assertNull ( vm ) ; }

Target:
public void getVmEmptyId ( ) { final org.ovirt.engine.core.common.businessentities.VM v = null ; b.setVm ( v ) ; b.setVmId ( Guid.Empty ) ; final org.ovirt.engine.core.common.businessentities.VM vm = b.getVm ( ) ; org.junit.Assert.assertNull ( vm ) ; }
Source:
private org.ovirt.engine.core.common.action.VdcReturnValueBase notAllowToRunAction ( org.ovirt.engine.core.common.action.VdcActionType actionType ) { java.lang.String mode = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdcOptionDao ( ) . getByNameAndVersion ( ConfigValues.EngineMode.name ( ) , Config.DefaultConfigurationVersion ) . getoption_value ( ) ; if ( EngineWorkingMode.MAINTENANCE.name ( ) . equalsIgnoreCase ( mode ) ) { return getErrorCommandReturnValue ( VdcBllMessages.ENGINE_IS_RUNNING_IN_MAINTENANCE_MODE ) ; } else if ( EngineWorkingMode.PREPARE.name ( ) . equalsIgnoreCase ( mode ) ) { return notAllowedInPrepForMaintMode ( actionType ) ; } return null ; }

Target:
private org.ovirt.engine.core.common.action.VdcReturnValueBase notAllowToRunAction ( org.ovirt.engine.core.common.action.VdcActionType actionType ) { java.lang.String mode = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdcOptionDao ( ) . getByNameAndVersion ( ConfigValues.EngineMode.name ( ) , ConfigCommon.defaultConfigurationVersion ) . getoption_value ( ) ; if ( EngineWorkingMode.MAINTENANCE.name ( ) . equalsIgnoreCase ( mode ) ) { return getErrorCommandReturnValue ( VdcBllMessages.ENGINE_IS_RUNNING_IN_MAINTENANCE_MODE ) ; } else if ( EngineWorkingMode.PREPARE.name ( ) . equalsIgnoreCase ( mode ) ) { return notAllowedInPrepForMaintMode ( actionType ) ; } return null ; }
Source:
public org.ovirt.engine.core.vdsbroker.irsbroker.StatusReturnForXmlRpc prepareMerge ( java.lang.String spUUID , java.lang.String jobUUID , java.util.Map < java.lang.String , java.lang.String > subchainInfo ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "SDM.prepare_merge" ) . withParameter ( "storagepoolID" , spUUID ) . withParameter ( "job_id" , jobUUID ) . withParameter ( "subchain_info" , subchainInfo ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.irsbroker.StatusReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturn finalizeMerge ( java.lang.String spUUID , java.util.Map < java.lang.String , java.lang.String > subchainInfo ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "StoragePool.finalizeMerge" ) . withParameter ( "storagepoolID" , spUUID ) . withParameter ( "subchainInfo" , subchainInfo ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "uuid" ) ; return new org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturn ( response ) ; }
Source:
public void save ( org.ovirt.engine.core.common.businessentities.image_storage_domain_map entity ) { getCallsHandler ( ) . executeModification ( "Insertimage_storage_domain_map" , getCustomMapSqlParameterSource ( ) . addValue ( "image_id" , entity.getimage_id ( ) ) . addValue ( "storage_domain_id" , entity.getstorage_domain_id ( ) ) . addValue ( "quota_id" , entity.getQuotaId ( ) ) ) ; }

Target:
public void save ( org.ovirt.engine.core.common.businessentities.image_storage_domain_map entity ) { getCallsHandler ( ) . executeModification ( "Insertimage_storage_domain_map" , getCustomMapSqlParameterSource ( ) . addValue ( "image_id" , entity.getimage_id ( ) ) . addValue ( "storage_domain_id" , entity.getstorage_domain_id ( ) ) . addValue ( "quota_id" , entity.getQuotaId ( ) ) . addValue ( "disk_profile_id" , entity.getDiskProfileId ( ) ) ) ; }
Source:
public static void GetExternalNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid providerId ) { 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.network.Network > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllExternalNetworksOnProvider , new org.ovirt.engine.core.common.queries.IdQueryParameters ( providerId ) , aQuery ) ; }

Target:
public static void getNumberOfActiveVmsInCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { if ( ( aQuery.converterCallback ) == null ) { 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.lang.Integer.valueOf ( 0 ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetNumberOfActiveVmsInVdsGroupByVdsGroupId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , 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.ovirt.engine.core.dal.dbbroker.DbFacadeLocator.setDbFacade ( dbFacade ) ; org.mockito.Mockito.doReturn ( deviceDao ) . when ( dbFacade ) . getVmDeviceDao ( ) ; }

Target:
public void InitTest ( ) { mockOsRepository ( ) ; org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.dal.dbbroker.DbFacade.class , dbFacade ) ; }
Source:
private void doQueryExecute ( org.ovirt.engine.api.extensions.ExtMap input , org.ovirt.engine.api.extensions.ExtMap output ) { org.ovirt.engine.extensions.aaa.builtin.internal.InternalAuthz.Opaque opaque = input.< org.ovirt.engine.extensions.aaa.builtin.internal.InternalAuthz.Opaque > get ( Authz.InvokeKeys.QUERY_OPAQUE ) ; output.put ( Authz.InvokeKeys.QUERY_RESULT , ( ( opaque.firstCall ) && ( opaque.isUser ) ? java.util.Arrays.asList ( adminUser ) : null ) ) ; opaque.firstCall = false ; }

Target:
private void doQueryExecute ( org.ovirt.engine.api.extensions.ExtMap input , org.ovirt.engine.api.extensions.ExtMap output ) { org.ovirt.engine.extensions.aaa.builtin.internal.InternalAuthz.Opaque opaque = input.< org.ovirt.engine.extensions.aaa.builtin.internal.InternalAuthz.Opaque > get ( Authz.InvokeKeys.QUERY_OPAQUE ) ; output.put ( Authz.InvokeKeys.QUERY_RESULT , ( ( opaque.firstCall ) && ( opaque.found ) ? java.util.Arrays.asList ( adminUser ) : null ) ) ; opaque.firstCall = false ; }