auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel createModel ( org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior ) { final org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setCompatibilityVersion ( org.ovirt.engine.ui.uicommonweb.models.vms.CLUSTER_VERSION ) ; org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = new org.ovirt.engine.ui.uicommonweb.models.pools.PoolModel ( behavior ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.Cluster getSelectedCluster ( ) { return cluster ; } } ; mockAsyncDataProvider ( model ) ; return model ; }

Target:
protected org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel createModel ( org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior ) { final org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setCompatibilityVersion ( org.ovirt.engine.ui.uicommonweb.models.vms.CLUSTER_VERSION ) ; org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = new org.ovirt.engine.ui.uicommonweb.models.pools.PoolModel ( behavior ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.Cluster getSelectedCluster ( ) { return cluster ; } } ; return model ; }
Source:
protected org.ovirt.engine.core.bll.MultipleActionsRunnerBaseTest.TestCommand createCommand ( boolean validationSucceeds , boolean executionSucceeds ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase = new org.ovirt.engine.core.common.action.VdcReturnValueBase ( ) ; returnValueBase.setValid ( validationSucceeds ) ; returnValueBase.setSucceeded ( executionSucceeds ) ; org.ovirt.engine.core.bll.MultipleActionsRunnerBaseTest.TestCommand command = new org.ovirt.engine.core.bll.MultipleActionsRunnerBaseTest.TestCommand ( returnValueBase ) ; command.setAuditLogDirector ( org.mockito.Mockito.mock ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.class ) ) ; return org.mockito.Mockito.spy ( command ) ; }

Target:
protected org.ovirt.engine.core.bll.MultipleActionsRunnerBaseTest.TestCommand createCommand ( boolean validationSucceeds , boolean executionSucceeds ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase = new org.ovirt.engine.core.common.action.VdcReturnValueBase ( ) ; returnValueBase.setValid ( validationSucceeds ) ; returnValueBase.setSucceeded ( executionSucceeds ) ; org.ovirt.engine.core.bll.MultipleActionsRunnerBaseTest.TestCommand command = new org.ovirt.engine.core.bll.MultipleActionsRunnerBaseTest.TestCommand ( returnValueBase ) ; return org.mockito.Mockito.spy ( command ) ; }
Source:
public void testStatisticalQuery ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface entity = setUpStatisticalExpectations ( ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) org.ovirt.engine.api.restapi.resource.BackendStatisticsResource < org.ovirt.engine.api.model.HostNIC , org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > statisticsResource = ( ( org.ovirt.engine.api.restapi.resource.BackendStatisticsResource < org.ovirt.engine.api.model.HostNIC , org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ) ( resource.getStatisticsResource ( ) ) ) ; assertNotNull ( statisticsResource ) ; verifyQuery ( statisticsResource.getQuery ( ) , entity ) ; }

Target:
public void testStatisticalQuery ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface entity = setUpStatisticalExpectations ( ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) org.ovirt.engine.api.restapi.resource.BackendStatisticsResource < org.ovirt.engine.api.model.HostNIC , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > statisticsResource = ( ( org.ovirt.engine.api.restapi.resource.BackendStatisticsResource < org.ovirt.engine.api.model.HostNIC , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ) ( resource.getStatisticsResource ( ) ) ) ; assertNotNull ( statisticsResource ) ; verifyQuery ( statisticsResource.getQuery ( ) , entity ) ; }
Source:
public void testGetByServerIdAndServiceType ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > services = dao.getByServerIdAndServiceType ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVER1_ID ) , org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVICE1_TYPE ) ; org.junit.Assert.assertNotNull ( services ) ; org.junit.Assert.assertEquals ( 1 , services.size ( ) ) ; verifyServiceOnServer1 ( services.get ( 0 ) ) ; }

Target:
public void testGetByServerIdAndServiceType ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > services = dao.getByServerIdAndServiceType ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVER1_ID , org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVICE1_TYPE ) ; org.junit.Assert.assertNotNull ( services ) ; org.junit.Assert.assertEquals ( 1 , services.size ( ) ) ; verifyServiceOnServer1 ( services.get ( 0 ) ) ; }
Source:
public void testRefreshUserSession ( ) { initDataForClearTest ( org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.USER ) ; container.getData ( org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.USER , true ) ; container.cleanExpiredUsersSessions ( ) ; org.junit.Assert.assertNotNull ( "Get should return null since the session wasn't refresh" , container.getData ( org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.USER , false ) ) ; clearSession ( ) ; }

Target:
public void testRefreshUserSession ( ) { container.getData ( org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.USER , true ) ; container.cleanExpiredUsersSessions ( ) ; java.lang.Object obj = container.getData ( org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.USER , false ) ; org.junit.Assert.assertNotNull ( "Get should return null since the session wasn't refresh" , container.getData ( org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.USER , false ) ) ; clearSession ( ) ; }
Source:
private void acquireLockAndWait ( ) { if ( ( context.getLock ( ) ) == null ) { java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > exclusiveLocks = getExclusiveLocks ( ) ; if ( exclusiveLocks != null ) { org.ovirt.engine.core.utils.lock.EngineLock lock = new org.ovirt.engine.core.utils.lock.EngineLock ( exclusiveLocks , null ) ; getLockManager ( ) . acquireLockWait ( lock ) ; context.withLock ( lock ) ; log.info ( "Lock-wait acquired to object '{}'" , lock ) ; } } }

Target:
private void acquireLockAndWait ( ) { if ( ( context.getLock ( ) ) == null ) { java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > exclusiveLocks = getExclusiveLocks ( ) ; if ( exclusiveLocks != null ) { org.ovirt.engine.core.utils.lock.EngineLock lock = new org.ovirt.engine.core.utils.lock.EngineLock ( exclusiveLocks , null ) ; getLockManager ( ) . acquireLockWait ( lock ) ; context.withLock ( lock ) ; } } }
Source:
public java.lang.String encodedId ( org.ovirt.engine.core.common.utils.ExternalId id ) { org.ovirt.engine.core.compat.Guid adGuid = new org.ovirt.engine.core.compat.Guid ( id.getBytes ( ) , false ) ; byte [ ] bytes = adGuid.toByteArray ( ) ; java.lang.StringBuilder sb = new java.lang.StringBuilder ( ) ; for ( int idx = 0 ; idx < ( bytes.length ) ; idx ++ ) { sb.append ( ( "\\" + ( java.lang.String.format ( "%02X" , bytes [ idx ] ) ) ) ) ; } return sb.toString ( ) ; }

Target:
public java.lang.String encodedId ( org.ovirt.engine.core.compat.Guid id ) { byte [ ] bytes = id.toByteArray ( ) ; java.lang.StringBuilder sb = new java.lang.StringBuilder ( ) ; for ( int idx = 0 ; idx < ( bytes.length ) ; idx ++ ) { sb.append ( ( "\\" + ( java.lang.String.format ( "%02X" , bytes [ idx ] ) ) ) ) ; } return sb.toString ( ) ; }
Source:
public void testGetRootWithHierarchy ( ) { org.ovirt.engine.core.common.businessentities.Tags tag = createTag ( "tag1" , "desc1" ) ; tagsDirector.addTag ( tag ) ; org.ovirt.engine.core.common.businessentities.Tags tags = tagsDirector.getRootTag ( ) ; org.junit.Assert.assertNotNull ( tags ) ; org.junit.Assert.assertEquals ( tags.getTagId ( ) , TagsDirector.ROOT_TAG_ID ) ; org.junit.Assert.assertEquals ( 1 , tags.getChildren ( ) . size ( ) ) ; org.junit.Assert.assertEquals ( "tag1" , tags.getChildren ( ) . get ( 0 ) . getTagName ( ) ) ; }

Target:
public void testGetRootWithHierarchy ( ) { org.ovirt.engine.core.common.businessentities.Tags tag = createTag ( "tag1" , "desc1" ) ; tagsDirector.addTag ( tag ) ; org.ovirt.engine.core.common.businessentities.Tags tags = tagsDirector.getRootTag ( ) ; org.junit.Assert.assertNotNull ( tags ) ; org.junit.Assert.assertEquals ( TagsDirector.ROOT_TAG_ID , tags.getTagId ( ) ) ; org.junit.Assert.assertEquals ( 1 , tags.getChildren ( ) . size ( ) ) ; org.junit.Assert.assertEquals ( "tag1" , tags.getChildren ( ) . get ( 0 ) . getTagName ( ) ) ; }
Source:
private org.apache.http.conn.ClientConnectionManager createPoolingClientConnectionManager ( java.lang.String url , int port ) { org.apache.http.conn.scheme.SchemeRegistry schemeRegistry = createSchemeRegistry ( url , port ) ; org.apache.http.impl.conn.PoolingClientConnectionManager cm = new org.apache.http.impl.conn.PoolingClientConnectionManager ( schemeRegistry ) ; cm.setMaxTotal ( org.ovirt.engine.sdk.web.ConnectionsPoolBuilder.MAX_CONNECTIONS ) ; cm.setDefaultMaxPerRoute ( org.ovirt.engine.sdk.web.ConnectionsPoolBuilder.MAX_CONNECTIONS_PER_ROUTE ) ; cm.setMaxPerRoute ( new org.apache.http.conn.routing.HttpRoute ( new org.apache.http.HttpHost ( getHost ( url ) , getPort ( url , port ) ) ) , org.ovirt.engine.sdk.web.ConnectionsPoolBuilder.MAX_CONNECTIONS_PER_HOST ) ; new org.ovirt.engine.sdk.web.IdleConnectionMonitorThread ( cm , org.ovirt.engine.sdk.web.ConnectionsPoolBuilder.WAIT_IDLE_CHECK_TTL , org.ovirt.engine.sdk.web.ConnectionsPoolBuilder.WAIT_IDLE_CLOSE_TTL ) . start ( ) ; return cm ; }

Target:
private org.apache.http.conn.ClientConnectionManager createPoolingClientConnectionManager ( java.lang.String url , int port ) { org.apache.http.conn.scheme.SchemeRegistry schemeRegistry = createSchemeRegistry ( url , port ) ; org.apache.http.impl.conn.PoolingClientConnectionManager cm = new org.apache.http.impl.conn.PoolingClientConnectionManager ( schemeRegistry ) ; cm.setMaxTotal ( org.ovirt.engine.sdk.web.ConnectionsPoolBuilder.MAX_CONNECTIONS ) ; cm.setDefaultMaxPerRoute ( org.ovirt.engine.sdk.web.ConnectionsPoolBuilder.MAX_CONNECTIONS_PER_ROUTE ) ; cm.setMaxPerRoute ( new org.apache.http.conn.routing.HttpRoute ( new org.apache.http.HttpHost ( getHost ( url ) , getPort ( url , port ) ) ) , org.ovirt.engine.sdk.web.ConnectionsPoolBuilder.MAX_CONNECTIONS_PER_HOST ) ; return cm ; }
Source:
protected boolean validate ( ) { getUserName ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; getPassword ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; getProfile ( ) . validateSelectedItem ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; return ( ( getUserName ( ) . getIsValid ( ) ) && ( getPassword ( ) . getIsValid ( ) ) ) && ( getProfile ( ) . getIsValid ( ) ) ; }

Target:
protected boolean validate ( ) { getUserName ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; getProfile ( ) . validateSelectedItem ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; return ( getUserName ( ) . getIsValid ( ) ) && ( getProfile ( ) . getIsValid ( ) ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > getImagesList ( ) { if ( ( ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getImagesList ( ) ) == null ) && ( ! ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getDstSnapshotId ( ) . equals ( Guid.Empty ) ) ) ) { org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . setImagesList ( getDiskImageDAO ( ) . getAllSnapshotsForVmSnapshot ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getDstSnapshotId ( ) ) ) ; } return org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getImagesList ( ) ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > getImagesList ( ) { if ( ( ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getImagesList ( ) ) == null ) && ( ! ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getDstSnapshotId ( ) . equals ( Guid.Empty ) ) ) ) { org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . setImagesList ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getDiskImageDAO ( ) . getAllSnapshotsForVmSnapshot ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getDstSnapshotId ( ) ) ) ; } return org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getImagesList ( ) ; }
Source:
private org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct generateOptions ( ) { org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct options = new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct ( ) ; if ( org.ovirt.engine.core.vdsbroker.vdsbroker.SetupNetworksVDSCommand.getParameters ( ) . isCheckConnectivity ( ) ) { options.add ( VdsProperties.connectivityCheck , "true" ) ; } else { options.add ( VdsProperties.connectivityCheck , "false" ) ; } if ( ( org.ovirt.engine.core.vdsbroker.vdsbroker.SetupNetworksVDSCommand.getParameters ( ) . getConectivityTimeout ( ) ) >= 0 ) { options.add ( VdsProperties.connectivityTimeout , new java.lang.Integer ( org.ovirt.engine.core.vdsbroker.vdsbroker.SetupNetworksVDSCommand.getParameters ( ) . getConectivityTimeout ( ) ) . toString ( ) ) ; } return options ; }

Target:
private org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct generateOptions ( ) { org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct options = new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct ( ) ; options.add ( VdsProperties.connectivityCheck , java.lang.Boolean.toString ( org.ovirt.engine.core.vdsbroker.vdsbroker.SetupNetworksVDSCommand.getParameters ( ) . isCheckConnectivity ( ) ) ) ; if ( ( org.ovirt.engine.core.vdsbroker.vdsbroker.SetupNetworksVDSCommand.getParameters ( ) . getConectivityTimeout ( ) ) >= 0 ) { options.add ( VdsProperties.connectivityTimeout , org.ovirt.engine.core.vdsbroker.vdsbroker.SetupNetworksVDSCommand.getParameters ( ) . getConectivityTimeout ( ) ) ; } return options ; }
Source:
protected void addCommands ( ) { org.ovirt.engine.ui.uicommonweb.UICommand tempVar2 = new org.ovirt.engine.ui.uicommonweb.UICommand ( "OnSave" , this ) ; tempVar2.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . ok ( ) ) ; tempVar2.setIsDefault ( true ) ; getCommands ( ) . add ( tempVar2 ) ; org.ovirt.engine.ui.uicommonweb.UICommand tempVar3 = new org.ovirt.engine.ui.uicommonweb.UICommand ( "Cancel" , this ) ; tempVar3.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . cancel ( ) ) ; tempVar3.setIsCancel ( true ) ; getCommands ( ) . add ( tempVar3 ) ; }

Target:
private void addCommands ( ) { org.ovirt.engine.ui.uicommonweb.UICommand tempVar2 = new org.ovirt.engine.ui.uicommonweb.UICommand ( "OnSave" , this ) ; tempVar2.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . ok ( ) ) ; tempVar2.setIsDefault ( true ) ; getCommands ( ) . add ( tempVar2 ) ; org.ovirt.engine.ui.uicommonweb.UICommand tempVar3 = new org.ovirt.engine.ui.uicommonweb.UICommand ( "Cancel" , this ) ; tempVar3.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . cancel ( ) ) ; tempVar3.setIsCancel ( true ) ; getCommands ( ) . add ( tempVar3 ) ; }
Source:
public java.util.List < java.lang.String > getList ( org.ovirt.engine.sdk.entities.DetailedLink link , java.lang.String key ) { java.lang.String value = get ( link , key ) ; if ( ( value == null ) || ( value.isEmpty ( ) ) ) { return java.util.Collections.emptyList ( ) ; } return java.util.Arrays.asList ( value.split ( "\\s" ) ) ; }

Target:
public java.util.List < java.lang.String > getList ( java.lang.String key ) { java.lang.String value = get ( key ) ; if ( ( value == null ) || ( value.isEmpty ( ) ) ) { return java.util.Collections.emptyList ( ) ; } return java.util.Arrays.asList ( value.split ( "\\s" ) ) ; }
Source:
private void addDiskPermissions ( org.ovirt.engine.core.common.businessentities.Disk disk ) { org.ovirt.engine.core.common.businessentities.permissions perms = new org.ovirt.engine.core.common.businessentities.permissions ( org.ovirt.engine.core.bll.AddDiskCommand.getCurrentUser ( ) . getUserId ( ) , PredefinedRoles.DISK_OPERATOR.getId ( ) , disk.getId ( ) , org.ovirt.engine.core.common.VdcObjectType.Disk ) ; org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.addPermission ( perms ) ; }

Target:
private void addDiskPermissions ( org.ovirt.engine.core.common.businessentities.Disk disk ) { org.ovirt.engine.core.common.businessentities.permissions perms = new org.ovirt.engine.core.common.businessentities.permissions ( org.ovirt.engine.core.bll.AddDiskCommand.getCurrentUser ( ) . getId ( ) , PredefinedRoles.DISK_OPERATOR.getId ( ) , disk.getId ( ) , org.ovirt.engine.core.common.VdcObjectType.Disk ) ; org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.addPermission ( perms ) ; }
Source:
public void testValidateStoragePoolSucceeds ( ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; storagePool.setStatus ( StoragePoolStatus.Up ) ; org.mockito.Mockito.when ( storagePoolDao.get ( storagePool.getId ( ) ) ) . thenReturn ( storagePool ) ; command.setStoragePoolId ( storagePool.getId ( ) ) ; org.junit.Assert.assertTrue ( command.validateStoragePool ( ) ) ; }

Target:
public void testValidateStoragePoolSucceeds ( ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; storagePool.setStatus ( StoragePoolStatus.Up ) ; org.mockito.Mockito.when ( storagePoolDao.get ( storagePool.getId ( ) ) ) . thenReturn ( storagePool ) ; command.setStoragePoolId ( storagePool.getId ( ) ) ; org.junit.Assert.assertTrue ( command.validate ( ) ) ; }
Source:
public void testActivate ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.ActivateStorageDomain , org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase.class , new java.lang.String [ ] { "StorageDomainId" , "StoragePoolId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.STORAGE_DOMAIN_ID , org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.DATA_CENTER_ID } ) ) ; verifyActionResponse ( resource.activate ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }

Target:
public void testActivate ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.ActivateStorageDomain , org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase.class , new java.lang.String [ ] { "StorageDomainId" , "StoragePoolId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.STORAGE_DOMAIN_ID , org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.DATA_CENTER_ID } ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; verifyActionResponse ( resource.activate ( action ) ) ; }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > diskList = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) . getAllAttachableDisksByPoolId ( org.ovirt.engine.core.bll.storage.disk.GetAllAttachableDisksForVmQuery.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.storage.disk.GetAllAttachableDisksForVmQuery.getParameters ( ) . getVmId ( ) , org.ovirt.engine.core.bll.storage.disk.GetAllAttachableDisksForVmQuery.getUserID ( ) , org.ovirt.engine.core.bll.storage.disk.GetAllAttachableDisksForVmQuery.getParameters ( ) . isFiltered ( ) ) ; if ( org.apache.commons.collections.CollectionUtils.isEmpty ( diskList ) ) { setReturnValue ( diskList ) ; return ; } setReturnValue ( diskList ) ; }

Target:
protected void executeQueryCommand ( ) { setReturnValue ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) . getAllAttachableDisksByPoolId ( org.ovirt.engine.core.bll.storage.disk.GetAllAttachableDisksForVmQuery.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.storage.disk.GetAllAttachableDisksForVmQuery.getParameters ( ) . getVmId ( ) , org.ovirt.engine.core.bll.storage.disk.GetAllAttachableDisksForVmQuery.getUserID ( ) , org.ovirt.engine.core.bll.storage.disk.GetAllAttachableDisksForVmQuery.getParameters ( ) . isFiltered ( ) ) ) ; }
Source:
public java.lang.String getProperty ( java.lang.String key ) { java.lang.String value = values.getProperty ( key ) ; if ( value == null ) { java.lang.String message = ( "The property \"" + key ) + "\" doesn\'t have a value." ; org.ovirt.engine.core.utils.LocalConfig.log.error ( message ) ; throw new java.lang.IllegalArgumentException ( message ) ; } return values.getProperty ( key ) ; }

Target:
public java.lang.String getProperty ( java.lang.String key ) { java.lang.String value = values.get ( key ) ; if ( value == null ) { java.lang.String message = ( "The property \"" + key ) + "\" doesn\'t have a value." ; org.ovirt.engine.core.utils.LocalConfig.log.error ( message ) ; throw new java.lang.IllegalArgumentException ( message ) ; } return values.get ( key ) ; }
Source:
public void getSpecParams ( ) { command.getParameters ( ) . setAction ( VmWatchdogAction.RESET ) ; command.getParameters ( ) . setModel ( vmWatchdogType ) ; java.util.HashMap < java.lang.String , java.lang.Object > specParams = command.getSpecParams ( ) ; org.junit.Assert.assertNotNull ( specParams ) ; org.junit.Assert.assertEquals ( "i6300esb" , specParams.get ( "model" ) ) ; org.junit.Assert.assertEquals ( "reset" , specParams.get ( "action" ) ) ; }

Target:
public void getSpecParams ( ) { command.getParameters ( ) . setAction ( VmWatchdogAction.RESET ) ; command.getParameters ( ) . setModel ( vmWatchdogType ) ; java.util.Map < java.lang.String , java.lang.Object > specParams = command.getSpecParams ( ) ; org.junit.Assert.assertNotNull ( specParams ) ; org.junit.Assert.assertEquals ( "i6300esb" , specParams.get ( "model" ) ) ; org.junit.Assert.assertEquals ( "reset" , specParams.get ( "action" ) ) ; }
Source:
public static void getVnicProfilesByNetworkId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid networkId ) { 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.VnicProfileView > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByNetworkId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( networkId ) , aQuery ) ; }

Target:
public void getVnicProfilesByNetworkId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid networkId ) { 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.VnicProfileView > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByNetworkId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( networkId ) , aQuery ) ; }
Source:
protected org.ovirt.engine.ui.uicommonweb.models.vms.VnicInstanceType createGhostValue ( ) { org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vnic = new org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface ( ) ; vnic.setName ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getNewNicName ( vnics ) ) ; vnics.add ( vnic ) ; org.ovirt.engine.ui.uicommonweb.models.vms.VnicInstanceType vnicWithProfile = new org.ovirt.engine.ui.uicommonweb.models.vms.VnicInstanceType ( vnic ) ; vnicWithProfile.setItems ( vnicProfiles ) ; return vnicWithProfile ; }

Target:
protected org.ovirt.engine.ui.uicommonweb.models.vms.VnicInstanceType createGhostValue ( ) { org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vnic = new org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface ( ) ; vnic.setName ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getNewNicName ( vnics ) ) ; vnics.add ( vnic ) ; org.ovirt.engine.ui.uicommonweb.models.vms.VnicInstanceType vnicWithProfile = new org.ovirt.engine.ui.uicommonweb.models.vms.VnicInstanceType ( vnic ) ; vnicWithProfile.setItems ( vnicProfiles ) ; return vnicWithProfile ; }
Source:
public void storagePoolIdWithStorageDomain ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; b.setStoragePoolId ( null ) ; b.setStoragePool ( null ) ; final org.ovirt.engine.core.common.businessentities.storage_domains s = new org.ovirt.engine.core.common.businessentities.storage_domains ( ) ; s.setstorage_pool_id ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; b.setStorageDomain ( s ) ; final org.ovirt.engine.core.compat.NGuid n = b.getStoragePoolId ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , n ) ; }

Target:
public void storagePoolIdWithStorageDomain ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; b.setStoragePoolId ( null ) ; b.setStoragePool ( null ) ; final org.ovirt.engine.core.common.businessentities.StorageDomain s = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; s.setstorage_pool_id ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; b.setStorageDomain ( s ) ; final org.ovirt.engine.core.compat.NGuid n = b.getStoragePoolId ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , n ) ; }
Source:
private static java.lang.Double computeInterfaceUsage ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , boolean totalStatsReported ) { java.lang.Double receiveRate = iface.getStatistics ( ) . getReceiveRate ( ) ; java.lang.Double transmitRate = iface.getStatistics ( ) . getTransmitRate ( ) ; if ( ! totalStatsReported ) { receiveRate = org.ovirt.engine.core.vdsbroker.NetworkStatisticsBuilder.truncatePercentage ( receiveRate ) ; transmitRate = org.ovirt.engine.core.vdsbroker.NetworkStatisticsBuilder.truncatePercentage ( transmitRate ) ; } if ( receiveRate == null ) { return transmitRate ; } else if ( transmitRate == null ) { return receiveRate ; } else { return java.lang.Math.max ( receiveRate , transmitRate ) ; } }

Target:
private static java.lang.Double computeInterfaceUsage ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface ) { java.lang.Double receiveRate = iface.getStatistics ( ) . getReceiveRate ( ) ; java.lang.Double transmitRate = iface.getStatistics ( ) . getTransmitRate ( ) ; if ( receiveRate == null ) { return transmitRate ; } else if ( transmitRate == null ) { return receiveRate ; } else { return java.lang.Math.max ( receiveRate , transmitRate ) ; } }
Source:
protected java.util.Collection < org.ovirt.engine.core.common.businessentities.VmTemplate > getEntitiesFromExportDomain ( ) { org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters params = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( getDataCenterId ( storageDomainId ) , storageDomainId ) ; params.setGetAll ( true ) ; java.util.Map < org.ovirt.engine.core.common.businessentities.VmTemplate , org.ovirt.engine.core.common.queries.DiskImageList > ret = getEntity ( java.util.HashMap.class , VdcQueryType.GetTemplatesFromExportDomain , params , ( "Templates under storage domain id : " + ( storageDomainId.toString ( ) ) ) ) ; return ret.keySet ( ) ; }

Target:
protected java.util.Collection < org.ovirt.engine.core.common.businessentities.VmTemplate > getEntitiesFromExportDomain ( ) { org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters params = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( getDataCenterId ( storageDomainId ) , storageDomainId ) ; java.util.Map < org.ovirt.engine.core.common.businessentities.VmTemplate , org.ovirt.engine.core.common.queries.DiskImageList > ret = getEntity ( java.util.HashMap.class , VdcQueryType.GetTemplatesFromExportDomain , params , ( "Templates under storage domain id : " + ( storageDomainId.toString ( ) ) ) ) ; return ret.keySet ( ) ; }
Source:
public void setUpBefore ( ) throws java.lang.Exception { super . setUpBefore ( ) ; baseIface = createBaseInterface ( null , null ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vlanIface = createVlanInterface ( baseIface , networkName , qosA ) ; setTestIface ( vlanIface ) ; org.mockito.Mockito.when ( calculateBaseNic.getBaseNic ( vlanIface ) ) . thenReturn ( baseIface ) ; org.mockito.Mockito.when ( calculateBaseNic.getBaseNic ( baseIface ) ) . thenReturn ( baseIface ) ; }

Target:
public void setUpBefore ( ) throws java.lang.Exception { super . setUpBefore ( ) ; baseIface = createBaseInterface ( null , null ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vlanIface = createVlanInterface ( baseIface , networkName , qosA ) ; setTestIface ( vlanIface ) ; org.mockito.Mockito.when ( calculateBaseNic.getBaseNic ( vlanIface ) ) . thenReturn ( baseIface ) ; }
Source:
private void testIsManagementNetworkInGivenClusterCommon ( boolean expectedResult ) { org.mockito.Mockito.when ( mockNetworkClusterDao.get ( org.mockito.Matchers.eq ( org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtilImplTest.TEST_NETWORK_CLUSTER_ID ) ) ) . thenReturn ( mockNetworkCluster ) ; org.mockito.Mockito.when ( mockNetworkCluster.isManagement ( ) ) . thenReturn ( expectedResult ) ; final boolean actual = underTest.isManagementNetwork ( org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtilImplTest.TEST_NETWORK_ID , org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtilImplTest.TEST_CLUSTER_ID ) ; org.junit.Assert.assertEquals ( expectedResult , actual ) ; }

Target:
private void testIsManagementNetworkInGivenClusterCommon ( boolean expectedResult ) { org.mockito.Mockito.when ( mockNetworkClusterDao.get ( org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtilImplTest.TEST_NETWORK_CLUSTER_ID ) ) . thenReturn ( mockNetworkCluster ) ; org.mockito.Mockito.when ( mockNetworkCluster.isManagement ( ) ) . thenReturn ( expectedResult ) ; final boolean actual = underTest.isManagementNetwork ( org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtilImplTest.TEST_NETWORK_ID , org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtilImplTest.TEST_CLUSTER_ID ) ; org.junit.Assert.assertEquals ( expectedResult , actual ) ; }
Source:
public java.lang.String toString ( ) { return ( ( ( ( ( ( "Path to theme: " + ( getPath ( ) ) ) + ", User portal css: " ) + ( getThemeStylesheets ( "userportal" ) ) ) + ", Web admin css: " ) + ( getThemeStylesheets ( "webadmin" ) ) ) + ", Welcome page css: " ) + ( getThemeStylesheets ( "welcome" ) ) ; }

Target:
public java.lang.String toString ( ) { return ( ( ( ( "Path to theme: " + ( getPath ( ) ) ) + ", User portal css: " ) + ( getThemeStylesheets ( "webadmin" ) ) ) + ", Welcome page css: " ) + ( getThemeStylesheets ( "welcome" ) ) ; }
Source:
public org.ovirt.engine.core.common.action.VdcActionParametersBase getParameters ( org.ovirt.engine.api.model.Network incoming , org.ovirt.engine.api.model.Network entity ) { org.ovirt.engine.api.model.Network updated = getMapper ( modelType , org.ovirt.engine.api.model.Network.class ) . map ( incoming , entity ) ; return new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( entity.getDataCenterId ( ) , updated ) ; }

Target:
public org.ovirt.engine.core.common.action.VdcActionParametersBase getParameters ( org.ovirt.engine.api.model.Network incoming , org.ovirt.engine.api.model.Network entity ) { org.ovirt.engine.api.model.Network updated = this . map ( incoming , entity ) ; return new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( entity.getDataCenterId ( ) , updated ) ; }
Source:
public void initialize ( java.util.ArrayList parameters ) { super . initialize ( parameters ) ; if ( ! ( ( parameters.get ( 3 ) ) instanceof java.lang.Boolean ) ) { throw new java.lang.IllegalArgumentException ( ) ; } isLastMaster = ( ( java.lang.Boolean ) ( parameters.get ( 3 ) ) ) ; if ( ! ( ( parameters.get ( 4 ) ) instanceof org.ovirt.engine.core.compat.Guid ) ) { throw new java.lang.IllegalArgumentException ( ) ; } newMasterStorageDomainId = ( ( org.ovirt.engine.core.compat.Guid ) ( parameters.get ( 4 ) ) ) ; }

Target:
public void initialize ( java.util.List parameters ) { super . initialize ( parameters ) ; if ( ! ( ( parameters.get ( 3 ) ) instanceof java.lang.Boolean ) ) { throw new java.lang.IllegalArgumentException ( ) ; } isLastMaster = ( ( java.lang.Boolean ) ( parameters.get ( 3 ) ) ) ; if ( ! ( ( parameters.get ( 4 ) ) instanceof org.ovirt.engine.core.compat.Guid ) ) { throw new java.lang.IllegalArgumentException ( ) ; } newMasterStorageDomainId = ( ( org.ovirt.engine.core.compat.Guid ) ( parameters.get ( 4 ) ) ) ; }
Source:
public static void getDataCenterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { 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.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "DataCenter: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }

Target:
public void getDataCenterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { 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.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "DataCenter: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue2 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskInterface > diskInterfaces = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskInterface > ) ( returnValue2 ) ) ; if ( java.lang.Boolean.FALSE.equals ( getIsVirtioScsiEnabled ( ) . getEntity ( ) ) ) { diskInterfaces.remove ( DiskInterface.VirtIO_SCSI ) ; } setInterfaces ( diskInterfaces ) ; }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskInterface > diskInterfaces ) { if ( java.lang.Boolean.FALSE.equals ( getIsVirtioScsiEnabled ( ) . getEntity ( ) ) ) { diskInterfaces.remove ( DiskInterface.VirtIO_SCSI ) ; } setInterfaces ( diskInterfaces ) ; }
Source:
public void initOvfDataUpdater ( ) { org.ovirt.engine.core.utils.timer.SchedulerUtil scheduler = org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) ; scheduler.scheduleAFixedDelayJob ( this , "ovfUpdate_timer" , new java.lang.Class [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.OvfUpdateIntervalInMinutes ) , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.OvfUpdateIntervalInMinutes ) , java.util.concurrent.TimeUnit.MINUTES ) ; org.ovirt.engine.core.bll.OvfDataUpdater.log.info ( "Initialization of OvfDataUpdater completed successfully." ) ; }

Target:
public void initOvfDataUpdater ( ) { org.ovirt.engine.core.utils.timer.SchedulerUtil scheduler = org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) ; scheduler.scheduleAFixedDelayJob ( this , "ovfUpdate_timer" , new java.lang.Class [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.OvfUpdateIntervalInMinutes ) , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.OvfUpdateIntervalInMinutes ) , java.util.concurrent.TimeUnit.MINUTES ) ; org.ovirt.engine.core.bll.OvfDataUpdater.log.info ( "Initialization of OvfDataUpdater completed successfully." ) ; }
Source:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setAllContentHeaderExpectation ( ) ; setUpEntityQueryExpectations ( 1 ) ; setGetGuestAgentQueryExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.Nic nic = resource.get ( ) ; verifyModelSpecific ( nic , 1 ) ; verifyLinks ( nic ) ; }

Target:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setAllContentHeaderExpectation ( ) ; setUpEntityQueryExpectations ( 1 ) ; setGetGuestAgentQueryExpectations ( 1 ) ; org.ovirt.engine.api.model.Nic nic = resource.get ( ) ; verifyModelSpecific ( nic , 1 ) ; verifyLinks ( nic ) ; }
Source:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( volumeId2 , 0 ) ) ; prepareMocks ( cmd ) ; mockBackend ( true , null ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( cmd ) . startSubStep ( ) ; org.mockito.Mockito.verify ( cmd ) . handleTaskReturn ( asyncTaskToBeReturned ) ; org.mockito.Mockito.verify ( cmd ) . updateBricksWithTaskID ( asyncTaskToBeReturned ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.START_REMOVING_GLUSTER_VOLUME_BRICKS ) ; }

Target:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( volumeId2 , 0 ) ) ; prepareMocks ( cmd ) ; mockBackend ( true , null ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( cmd ) . startSubStep ( ) ; org.mockito.Mockito.verify ( cmd ) . handleTaskReturn ( asyncTaskToBeReturned ) ; org.mockito.Mockito.verify ( cmd ) . updateBricksWithTaskID ( asyncTaskToBeReturned ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.START_REMOVING_GLUSTER_VOLUME_BRICKS ) ; }
Source:
private void populateValueForConfigValue ( org.ovirt.engine.core.common.queries.ConfigurationValues configValue , java.lang.String version , java.util.Map < org.ovirt.engine.core.compat.KeyValuePairCompat < org.ovirt.engine.core.common.queries.ConfigurationValues , java.lang.String > , java.lang.Object > configValuesMap ) { org.ovirt.engine.core.compat.KeyValuePairCompat < org.ovirt.engine.core.common.queries.ConfigurationValues , java.lang.String > key = new org.ovirt.engine.core.compat.KeyValuePairCompat ( configValue , version ) ; java.lang.Object value = org.ovirt.engine.core.common.config.Config.getValue ( org.ovirt.engine.core.common.config.ConfigValues.valueOf ( configValue.toString ( ) ) , version ) ; configValuesMap.put ( key , value ) ; }

Target:
private void populateValueForConfigValue ( org.ovirt.engine.core.common.config.ConfigValues configValue , java.lang.String version , java.util.Map < org.ovirt.engine.core.compat.KeyValuePairCompat < org.ovirt.engine.core.common.config.ConfigValues , java.lang.String > , java.lang.Object > configValuesMap ) { org.ovirt.engine.core.compat.KeyValuePairCompat < org.ovirt.engine.core.common.config.ConfigValues , java.lang.String > key = new org.ovirt.engine.core.compat.KeyValuePairCompat ( configValue , version ) ; java.lang.Object value = org.ovirt.engine.core.common.config.Config.getValue ( configValue , version ) ; configValuesMap.put ( key , value ) ; }
Source:
protected void endWithFailure ( ) { super . endActionOnDisks ( ) ; if ( ( org.ovirt.engine.core.bll.AddVmCommand.getVm ( ) ) != null ) { removeVmInSpm ( org.ovirt.engine.core.bll.AddVmCommand.getVm ( ) . getstorage_pool_id ( ) , org.ovirt.engine.core.bll.AddVmCommand.getVmId ( ) ) ; } removeVmRelatedEntitiesFromDb ( ) ; org.ovirt.engine.core.bll.AddVmCommand.setSucceeded ( true ) ; }

Target:
protected void endWithFailure ( ) { super . endActionOnDisks ( ) ; if ( ( org.ovirt.engine.core.bll.AddVmCommand.getVm ( ) ) != null ) { removeVmInSpm ( org.ovirt.engine.core.bll.AddVmCommand.getVm ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.AddVmCommand.getVmId ( ) ) ; } removeVmRelatedEntitiesFromDb ( ) ; org.ovirt.engine.core.bll.AddVmCommand.setSucceeded ( true ) ; }
Source:
public void validateFailsIfHostDoesNotExists ( ) { org.mockito.Mockito.when ( vdsDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.ovirt.engine.core.common.action.hostdeploy.InstallVdsParameters param = org.ovirt.engine.core.bll.hostdeploy.InstallVdsInternalCommandTest.createParameters ( ) ; org.ovirt.engine.core.bll.hostdeploy.InstallVdsInternalCommand < org.ovirt.engine.core.common.action.hostdeploy.InstallVdsParameters > command = createCommand ( param ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_HOST_NOT_EXIST ) ; }

Target:
public void validateFailsIfHostDoesNotExists ( ) { org.mockito.Mockito.when ( vdsDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_HOST_NOT_EXIST ) ; }
Source:
public static java.util.Map < java.lang.String , java.lang.Object > jsonToMapUnchecked ( java.lang.String jsonString ) { try { return org.ovirt.engine.core.utils.JsonHelper.jsonToMap ( jsonString ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( java.lang.String.format ( "Json string \"%s\" cannot be parsed to a Map." , jsonString ) , e ) ; } }

Target:
public static java.util.Map < java.lang.String , java.lang.Object > jsonToMapUnchecked ( java.lang.String jsonString ) { if ( jsonString == null ) { return null ; } try { return org.ovirt.engine.core.utils.JsonHelper.jsonToMap ( jsonString ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( java.lang.String.format ( "Json string \"%s\" cannot be parsed to a Map." , jsonString ) , e ) ; } }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( T item ) { java.lang.String osTypeName = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getOsUniqueOsNames ( ) . get ( extractor.extractOsType ( item ) ) ; com.google.gwt.resources.client.ResourcePrototype resource = org.ovirt.engine.ui.userportal.widget.table.column.VmImageColumn.getApplicationResourcesWithLookup ( ) . getResource ( ( osTypeName + "SmallImage" ) ) ; if ( ! ( resource instanceof com.google.gwt.resources.client.ImageResource ) ) { resource = org.ovirt.engine.ui.userportal.widget.table.column.VmImageColumn.getApplicationResourcesWithLookup ( ) . otherSmallImage ( ) ; } return ( ( com.google.gwt.resources.client.ImageResource ) ( resource ) ) ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( T item ) { java.lang.String osTypeName = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getOsUniqueOsNames ( ) . get ( extractor.extractOsType ( item ) ) ; com.google.gwt.resources.client.ResourcePrototype resource = org.ovirt.engine.ui.userportal.widget.table.column.VmImageColumn.getApplicationResourcesWithLookup ( ) . getResource ( ( osTypeName + "SmallImage" ) ) ; if ( ! ( resource instanceof com.google.gwt.resources.client.ImageResource ) ) { resource = org.ovirt.engine.ui.userportal.widget.table.column.VmImageColumn.getApplicationResourcesWithLookup ( ) . otherSmallImage ( ) ; } return ( ( com.google.gwt.resources.client.ImageResource ) ( resource ) ) ; }
Source:
public void testRefreshStatus ( ) { org.mockito.Mockito.doReturn ( getSessionDetailsVDSReturnVal ( true ) ) . when ( syncJob ) . runVdsCommand ( org.mockito.ArgumentMatchers.eq ( VDSCommandType.GetGlusterVolumeGeoRepSessionStatus ) , org.mockito.ArgumentMatchers.any ( ) ) ; syncJob.refreshGeoRepSessionStatus ( ) ; org.mockito.Mockito.verify ( geoRepDao , org.mockito.Mockito.times ( 2 ) ) . saveOrUpdateDetailsInBatch ( org.mockito.ArgumentMatchers.anyList ( ) ) ; }

Target:
public void testRefreshStatus ( ) { org.mockito.Mockito.doReturn ( getSessionDetailsVDSReturnVal ( true ) ) . when ( syncJob ) . runVdsCommand ( org.mockito.ArgumentMatchers.eq ( VDSCommandType.GetGlusterVolumeGeoRepSessionStatus ) , org.mockito.ArgumentMatchers.any ( ) ) ; syncJob.refreshGeoRepSessionStatus ( ) ; org.mockito.Mockito.verify ( geoRepDao , org.mockito.Mockito.times ( 2 ) ) . saveOrUpdateDetailsInBatch ( org.mockito.ArgumentMatchers.any ( ) ) ; }