auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static java.util.List < java.lang.String > getBondNics ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond , java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > interfaces ) { java.util.List < java.lang.String > nics = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface i : interfaces ) { if ( bond.getName ( ) . equals ( i.getBondName ( ) ) ) { nics.add ( i.getName ( ) ) ; } } return nics ; }

Target:
private static java.util.List < java.lang.String > getBondNics ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface bond , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > interfaces ) { java.util.List < java.lang.String > nics = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i : interfaces ) { if ( bond.getName ( ) . equals ( i.getBondName ( ) ) ) { nics.add ( i.getName ( ) ) ; } } return nics ; }
Source:
public void testGetRelatedTableName ( ) { org.junit.Assert.assertEquals ( "EVENTS" , "audit_log" , comp.getRelatedTableName ( "EVENTS" ) ) ; org.junit.Assert.assertNull ( "Garbage" , comp.getRelatedTableName ( "kjfhkjdshkjfs" ) ) ; org.junit.Assert.assertNull ( "Null" , comp.getRelatedTableName ( null ) ) ; }

Target:
public void testGetRelatedTableName ( ) { org.junit.Assert.assertEquals ( "EVENTS" , "audit_log" , comp.getRelatedTableName ( "EVENTS" , true ) ) ; org.junit.Assert.assertNull ( "Garbage" , comp.getRelatedTableName ( "kjfhkjdshkjfs" , true ) ) ; org.junit.Assert.assertNull ( "Null" , comp.getRelatedTableName ( null , true ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VDS createServer ( org.ovirt.engine.core.compat.Guid serverId , java.lang.String hostname , org.ovirt.engine.core.compat.Version version ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( serverId ) ; vds.setHostName ( hostname ) ; vds.setStatus ( VDSStatus.Up ) ; vds.setClusterCompatibilityVersion ( version ) ; return vds ; }

Target:
private org.ovirt.engine.core.common.businessentities.VDS createServer ( org.ovirt.engine.core.compat.Guid serverId , java.lang.String hostname ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( serverId ) ; vds.setHostName ( hostname ) ; vds.setStatus ( VDSStatus.Up ) ; return vds ; }
Source:
private java.lang.String getLocalStoragesFormattedString ( ) { java.lang.StringBuilder localStorages = new java.lang.StringBuilder ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain a : org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.StorageDomain > cast ( getSelectedItems ( ) ) ) { if ( ( a.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.StorageType.LOCALFS ) ) { localStorages.append ( a.getStorageName ( ) ) . append ( ", " ) ; } } return localStorages.substring ( 0 , ( ( localStorages.length ( ) ) - 2 ) ) ; }

Target:
private java.lang.String getLocalStoragesFormattedString ( ) { java.lang.StringBuilder localStorages = new java.lang.StringBuilder ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain a : getSelectedItems ( ) ) { if ( ( a.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.StorageType.LOCALFS ) ) { localStorages.append ( a.getStorageName ( ) ) . append ( ", " ) ; } } return localStorages.substring ( 0 , ( ( localStorages.length ( ) ) - 2 ) ) ; }
Source:
protected < X > void render ( org.ovirt.engine.ui.webadmin.widget.table.cell.Context context , T value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb , com.google.gwt.cell.client.HasCell < T , X > hasCell ) { com.google.gwt.cell.client.Cell < X > cell = hasCell.getCell ( ) ; sb.appendHtmlConstant ( "<td>" ) ; cell.render ( context , hasCell.getValue ( value ) , sb ) ; sb.appendHtmlConstant ( "</td>" ) ; }

Target:
protected < X > void render ( org.ovirt.engine.ui.webadmin.widget.table.cell.Context context , T value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb , com.google.gwt.cell.client.HasCell < T , X > hasCell , java.lang.String id ) { com.google.gwt.cell.client.Cell < X > cell = hasCell.getCell ( ) ; sb.appendHtmlConstant ( "<td>" ) ; cell.render ( context , hasCell.getValue ( value ) , sb ) ; sb.appendHtmlConstant ( "</td>" ) ; }
Source:
public void testBuildVmNumatuneSetting ( ) throws java.lang.Exception { java.util.Map < java.lang.String , java.lang.Object > numaTune = org.ovirt.engine.core.vdsbroker.vdsbroker.NumaSettingFactory.buildVmNumatuneSetting ( org.ovirt.engine.core.vdsbroker.vdsbroker.NumaSettingFactoryTest.numaTuneMode , org.ovirt.engine.core.vdsbroker.vdsbroker.NumaSettingFactoryTest.vmNumaNodes , org.ovirt.engine.core.vdsbroker.vdsbroker.NumaSettingFactoryTest.vdsNumaNodes ) ; org.junit.Assert.assertEquals ( 2 , numaTune.size ( ) ) ; org.junit.Assert.assertTrue ( numaTune.containsKey ( VdsProperties.NUMA_TUNE_MODE ) ) ; org.junit.Assert.assertEquals ( NumaTuneMode.INTERLEAVE.getValue ( ) , numaTune.get ( VdsProperties.NUMA_TUNE_MODE ) ) ; org.junit.Assert.assertTrue ( numaTune.containsKey ( VdsProperties.NUMA_TUNE_NODESET ) ) ; org.junit.Assert.assertEquals ( "0,1" , numaTune.get ( VdsProperties.NUMA_TUNE_NODESET ) ) ; }

Target:
public void testBuildVmNumatuneSetting ( ) throws java.lang.Exception { java.util.Map < java.lang.String , java.lang.Object > numaTune = org.ovirt.engine.core.vdsbroker.vdsbroker.NumaSettingFactory.buildVmNumatuneSetting ( org.ovirt.engine.core.vdsbroker.vdsbroker.NumaSettingFactoryTest.numaTuneMode , org.ovirt.engine.core.vdsbroker.vdsbroker.NumaSettingFactoryTest.vmNumaNodes ) ; org.junit.Assert.assertEquals ( 2 , numaTune.size ( ) ) ; org.junit.Assert.assertTrue ( numaTune.containsKey ( VdsProperties.NUMA_TUNE_MODE ) ) ; org.junit.Assert.assertEquals ( NumaTuneMode.INTERLEAVE.getValue ( ) , numaTune.get ( VdsProperties.NUMA_TUNE_MODE ) ) ; org.junit.Assert.assertTrue ( numaTune.containsKey ( VdsProperties.NUMA_TUNE_NODESET ) ) ; org.junit.Assert.assertEquals ( "0,1" , numaTune.get ( VdsProperties.NUMA_TUNE_NODESET ) ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult result ) { java.util.List < org.ovirt.engine.core.common.queries.VdcQueryReturnValue > returnValueList = result.getReturnValues ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > templates = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ) ( returnValueList.get ( 0 ) . getReturnValue ( ) ) ) ; initTemplateWithVersion ( templates , null , false ) ; initCdImage ( ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult result ) { initCdImage ( ) ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > getStorageDomainsByIds ( java.util.ArrayList < org.ovirt.engine.core.compat.Guid > storageIds , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > list = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.compat.Guid storageId : storageIds ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = org.ovirt.engine.ui.uicommonweb.Linq.getStorageById ( storageId , storageDomains ) ; if ( storageDomain != null ) { list.add ( storageDomain ) ; } } return list ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > getStorageDomainsByIds ( java.util.List < org.ovirt.engine.core.compat.Guid > storageIds , java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > list = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.compat.Guid storageId : storageIds ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = org.ovirt.engine.ui.uicommonweb.Linq.getStorageById ( storageId , storageDomains ) ; if ( storageDomain != null ) { list.add ( storageDomain ) ; } } return list ; }
Source:
public void testClusterLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster ( ) ; cluster.setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.CLUSTER_ID ) ; cluster.setDataCenter ( new org.ovirt.engine.api.model.DataCenter ( ) ) ; cluster.getDataCenter ( ) . setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.DATA_CENTER_ID ) ; org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( setUpUriExpectations ( ) , cluster ) ; assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.CLUSTER_HREF , cluster.getHref ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.DATA_CENTER_HREF , cluster.getDataCenter ( ) . getHref ( ) ) ; }

Target:
public void testClusterLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster ( ) ; cluster.setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.CLUSTER_ID ) ; cluster.setDataCenter ( new org.ovirt.engine.api.model.DataCenter ( ) ) ; cluster.getDataCenter ( ) . setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.DATA_CENTER_ID ) ; org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( cluster ) ; assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.CLUSTER_HREF , cluster.getHref ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.DATA_CENTER_HREF , cluster.getDataCenter ( ) . getHref ( ) ) ; }
Source:
public void testListFailure ( ) throws java.lang.Exception { collection.setUriInfo ( setUpUriExpectations ( null ) ) ; setUpHooksQueryExpectations ( org.ovirt.engine.api.restapi.resource.gluster.FAILURE ) ; control.replay ( ) ; try { getCollection ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertTrue ( ( ( wae.getResponse ( ) . getEntity ( ) ) instanceof org.ovirt.engine.api.model.Fault ) ) ; assertEquals ( mockl10n ( org.ovirt.engine.api.restapi.resource.gluster.FAILURE ) , ( ( org.ovirt.engine.api.model.Fault ) ( wae.getResponse ( ) . getEntity ( ) ) ) . getDetail ( ) ) ; } }

Target:
public void testListFailure ( ) throws java.lang.Exception { collection.setUriInfo ( setUpUriExpectations ( null ) ) ; setUpHooksQueryExpectations ( org.ovirt.engine.api.restapi.resource.gluster.FAILURE ) ; try { getCollection ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertTrue ( ( ( wae.getResponse ( ) . getEntity ( ) ) instanceof org.ovirt.engine.api.model.Fault ) ) ; assertEquals ( mockl10n ( org.ovirt.engine.api.restapi.resource.gluster.FAILURE ) , ( ( org.ovirt.engine.api.model.Fault ) ( wae.getResponse ( ) . getEntity ( ) ) ) . getDetail ( ) ) ; } }
Source:
public void disableGlusterWhenVolumesExist ( ) { createCommandWithVirtEnabled ( ) ; org.mockito.Mockito.when ( clusterDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createClusterWithNoCpuName ( ) ) ; cpuExists ( ) ; cpuFlagsNotMissing ( ) ; allQueriesForVms ( ) ; clusterHasGlusterVolumes ( ) ; validateFailedWithReason ( EngineMessage.CLUSTER_CANNOT_DISABLE_GLUSTER_WHEN_CLUSTER_CONTAINS_VOLUMES ) ; }

Target:
public void disableGlusterWhenVolumesExist ( ) { createCommandWithVirtEnabled ( ) ; org.mockito.Mockito.when ( clusterDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createClusterWithNoCpuName ( ) ) ; cpuExists ( ) ; cpuFlagsNotMissing ( ) ; clusterHasGlusterVolumes ( ) ; validateFailedWithReason ( EngineMessage.CLUSTER_CANNOT_DISABLE_GLUSTER_WHEN_CLUSTER_CONTAINS_VOLUMES ) ; }
Source:
public void addExistingConnection ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createPosixConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data1" , StorageType.POSIXFS , "nfs" , "timeo=30" ) ; parameters.setStorageServerConnection ( newPosixConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . isConnWithSameDetailsExists ( newPosixConnection ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_CONNECTION_ALREADY_EXISTS ) ; }

Target:
public void addExistingConnection ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createPosixConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data1" , StorageType.POSIXFS , "nfs" , "timeo=30" ) ; parameters.setStorageServerConnection ( newPosixConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . isConnWithSameDetailsExists ( newPosixConnection , null ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_CONNECTION_ALREADY_EXISTS ) ; }
Source:
private void assertValidationWorks ( int nameLength , int numOfVms , boolean expected ) { org.ovirt.engine.ui.uicommonweb.validation.PoolNameLengthValidation validation = new org.ovirt.engine.ui.uicommonweb.validation.PoolNameLengthValidation ( nameOfLength ( nameLength ) , numOfVms , org.ovirt.engine.core.common.businessentities.VmOsType.Windows2003 ) ; org.junit.Assert.assertThat ( validation.Validate ( null ) . getSuccess ( ) , org.hamcrest.core.Is.is ( org.hamcrest.core.IsEqual.equalTo ( expected ) ) ) ; }

Target:
private void assertValidationWorks ( int nameLength , int numOfVms , boolean expected ) { org.ovirt.engine.ui.uicommonweb.validation.PoolNameLengthValidation validation = new org.ovirt.engine.ui.uicommonweb.validation.PoolNameLengthValidation ( nameOfLength ( nameLength ) , numOfVms , org.ovirt.engine.core.common.businessentities.VmOsType.Windows2003 ) ; org.junit.Assert.assertThat ( validation.validate ( null ) . getSuccess ( ) , org.hamcrest.core.Is.is ( org.hamcrest.core.IsEqual.equalTo ( expected ) ) ) ; }
Source:
public void setUp ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.pool.ReconstructMasterDomainCommand ( new org.ovirt.engine.core.common.action.ReconstructMasterParameters ( ) ) ) ; initializeStorageDomains ( ) ; initializeStoragePool ( ) ; initializeStoragePoolValidator ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . initializeVds ( ) ; }

Target:
public void setUp ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.pool.ReconstructMasterDomainCommand ( new org.ovirt.engine.core.common.action.ReconstructMasterParameters ( ) , null ) ) ; initializeStorageDomains ( ) ; initializeStoragePool ( ) ; initializeStoragePoolValidator ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . initializeVds ( ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.DataCenter dataCenter ) { validateParameters ( dataCenter , "name" ) ; validateEnums ( org.ovirt.engine.api.model.DataCenter.class , dataCenter ) ; if ( ! ( dataCenter.isSetLocal ( ) ) ) { validateParameters ( dataCenter , "local" ) ; } org.ovirt.engine.core.common.businessentities.StoragePool entity = map ( dataCenter ) ; return performCreate ( VdcActionType.AddEmptyStoragePool , new org.ovirt.engine.core.common.action.StoragePoolManagementParameter ( entity ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetStoragePoolById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.DataCenter dataCenter ) { validateParameters ( dataCenter , "name" ) ; if ( ! ( dataCenter.isSetLocal ( ) ) ) { validateParameters ( dataCenter , "local" ) ; } org.ovirt.engine.core.common.businessentities.StoragePool entity = map ( dataCenter ) ; return performCreate ( VdcActionType.AddEmptyStoragePool , new org.ovirt.engine.core.common.action.StoragePoolManagementParameter ( entity ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetStoragePoolById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }
Source:
public void testGetEntityNameByIdAndTypeForDisk ( ) { org.ovirt.engine.core.common.businessentities.storage.BaseDisk disk = baseDiskDao.get ( org.ovirt.engine.core.dao.EntityDaoImplTest.DISK_ID ) ; org.junit.Assert.assertNotNull ( disk ) ; java.lang.String name = disk.getDiskAlias ( ) ; org.junit.Assert.assertTrue ( name.equals ( underTest.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.EntityDaoImplTest.DISK_ID , VdcObjectType.Disk ) ) ) ; }

Target:
public void testGetEntityNameByIdAndTypeForDisk ( ) { org.ovirt.engine.core.common.businessentities.storage.BaseDisk disk = baseDiskDao.get ( org.ovirt.engine.core.dao.EntityDaoImplTest.DISK_ID ) ; org.junit.Assert.assertNotNull ( disk ) ; java.lang.String name = disk.getDiskAlias ( ) ; org.junit.Assert.assertEquals ( name , underTest.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.EntityDaoImplTest.DISK_ID , VdcObjectType.Disk ) ) ; }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( java.util.Collections.emptyList ( ) ) ; control.replay ( ) ; try { resource.remove ( ) ; 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 { setUpEntityQueryExpectations ( java.util.Collections.emptyList ( ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
protected boolean isDomainAttached ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { if ( ( storageDomain.getstorage_pool_id ( ) ) == null ) { return false ; } org.ovirt.engine.core.compat.Guid storageDomainId = storageDomain.getId ( ) ; org.ovirt.engine.core.compat.Guid storagePoolId = storageDomain.getstorage_pool_id ( ) . getValue ( ) ; return ( org.ovirt.engine.core.bll.storage.RemoveStorageDomainCommand.getDbFacade ( ) . getStoragePoolIsoMapDao ( ) . get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( storageDomainId , storagePoolId ) ) ) != null ; }

Target:
protected boolean isDomainAttached ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { if ( ( storageDomain.getStoragePoolId ( ) ) == null ) { return false ; } org.ovirt.engine.core.compat.Guid storageDomainId = storageDomain.getId ( ) ; org.ovirt.engine.core.compat.Guid storagePoolId = storageDomain.getStoragePoolId ( ) . getValue ( ) ; return ( org.ovirt.engine.core.bll.storage.RemoveStorageDomainCommand.getDbFacade ( ) . getStoragePoolIsoMapDao ( ) . get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( storageDomainId , storagePoolId ) ) ) != null ; }
Source:
private void addOsTypes ( org.ovirt.engine.api.model.VersionCaps version ) { version.setOsTypes ( new org.ovirt.engine.api.model.OsTypes ( ) ) ; if ( org.ovirt.engine.api.restapi.utils.VersionUtils.greaterOrEqual ( version , org.ovirt.engine.api.restapi.resource.BackendCapabilitiesResource.VERSION_3_3 ) ) { version.getOsTypes ( ) . getOsTypes ( ) . addAll ( org.ovirt.engine.api.model.OsTypeUtils.getAllValues ( ) ) ; } else { for ( org.ovirt.engine.api.model.OsType type : org.ovirt.engine.api.model.OsType.values ( ) ) { version.getOsTypes ( ) . getOsTypes ( ) . add ( type.name ( ) ) ; } } }

Target:
private void addOsTypes ( org.ovirt.engine.api.model.VersionCaps version ) { version.setOsTypes ( new org.ovirt.engine.api.model.OsTypes ( ) ) ; version.getOsTypes ( ) . getOsTypes ( ) . addAll ( org.ovirt.engine.api.model.OsTypeUtils.getAllValues ( ) ) ; }
Source:
public static boolean isTaskStatus ( org.ovirt.engine.core.common.businessentities.gluster.GlusterTaskSupport supportObj , org.ovirt.engine.core.common.job.JobExecutionStatus status ) { if ( ( ( supportObj.getAsyncTask ( ) ) != null ) && ( ( supportObj.getAsyncTask ( ) . getStatus ( ) ) == status ) ) { return true ; } return false ; }

Target:
public boolean isTaskStatus ( org.ovirt.engine.core.common.businessentities.gluster.GlusterTaskSupport supportObj , org.ovirt.engine.core.common.job.JobExecutionStatus status ) { if ( ( ( supportObj.getAsyncTask ( ) ) != null ) && ( ( supportObj.getAsyncTask ( ) . getStatus ( ) ) == status ) ) { return true ; } return false ; }
Source:
public static org.ovirt.engine.core.common.businessentities.storage_pool buildStoragePool ( java.util.Map < java.lang.String , java.lang.Object > xmlRpcStruct ) { org.ovirt.engine.core.common.businessentities.storage_pool sPool = new org.ovirt.engine.core.common.businessentities.storage_pool ( ) ; if ( xmlRpcStruct.containsKey ( "type" ) ) { sPool.setstorage_pool_type ( org.ovirt.engine.core.common.businessentities.StorageType.valueOf ( xmlRpcStruct.get ( "type" ) . toString ( ) ) ) ; } sPool.setname ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.AssignStringValue ( xmlRpcStruct , "name" ) ) ; java.lang.Integer masterVersion = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.AssignIntValue ( xmlRpcStruct , "master_ver" ) ; if ( masterVersion != null ) { sPool.setmaster_domain_version ( masterVersion ) ; } return sPool ; }

Target:
public static org.ovirt.engine.core.common.businessentities.StoragePool buildStoragePool ( java.util.Map < java.lang.String , java.lang.Object > xmlRpcStruct ) { org.ovirt.engine.core.common.businessentities.StoragePool sPool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; if ( xmlRpcStruct.containsKey ( "type" ) ) { sPool.setstorage_pool_type ( org.ovirt.engine.core.common.businessentities.StorageType.valueOf ( xmlRpcStruct.get ( "type" ) . toString ( ) ) ) ; } sPool.setname ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.AssignStringValue ( xmlRpcStruct , "name" ) ) ; java.lang.Integer masterVersion = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.AssignIntValue ( xmlRpcStruct , "master_ver" ) ; if ( masterVersion != null ) { sPool.setmaster_domain_version ( masterVersion ) ; } return sPool ; }
Source:
public static synchronized java.lang.String [ ] getLinksToExclude ( org.ovirt.engine.api.model.StorageDomain storageDomain ) { return org.ovirt.engine.api.restapi.resource.BackendStorageDomainResource.isIsoDomain ( storageDomain ) ? new java.lang.String [ ] { "templates" , "vms" , "disks" , "images" } : org.ovirt.engine.api.restapi.resource.BackendStorageDomainResource.isExportDomain ( storageDomain ) ? new java.lang.String [ ] { "files" , "images" } : org.ovirt.engine.api.restapi.resource.BackendStorageDomainResource.isImageDomain ( storageDomain ) ? new java.lang.String [ ] { "templates" , "vms" , "files" , "disks" , "storageconnections" } : new java.lang.String [ ] { "templates" , "vms" , "files" , "images" } ; }

Target:
public static synchronized java.lang.String [ ] getLinksToExclude ( org.ovirt.engine.api.model.StorageDomain storageDomain ) { return org.ovirt.engine.api.restapi.resource.BackendStorageDomainResource.isIsoDomain ( storageDomain ) ? new java.lang.String [ ] { "templates" , "vms" , "disks" , "images" } : org.ovirt.engine.api.restapi.resource.BackendStorageDomainResource.isExportDomain ( storageDomain ) ? new java.lang.String [ ] { "files" , "images" } : org.ovirt.engine.api.restapi.resource.BackendStorageDomainResource.isImageDomain ( storageDomain ) ? new java.lang.String [ ] { "templates" , "vms" , "files" , "disks" , "storageconnections" } : new java.lang.String [ ] { "files" , "images" } ; }
Source:
public boolean equals ( java.lang.Object obj ) { if ( obj == null ) { return false ; } if ( ( this ) == obj ) { return true ; } if ( ( obj.getClass ( ) ) != ( this . getClass ( ) ) ) { return false ; } org.ovirt.engine.core.common.businessentities.EngineBackupLog other = ( ( org.ovirt.engine.core.common.businessentities.EngineBackupLog ) ( obj ) ) ; return ( java.util.Objects.equals ( scope , other.scope ) ) && ( java.util.Objects.equals ( doneAt , other.doneAt ) ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( obj == null ) { return false ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.EngineBackupLog ) ) { return false ; } org.ovirt.engine.core.common.businessentities.EngineBackupLog other = ( ( org.ovirt.engine.core.common.businessentities.EngineBackupLog ) ( obj ) ) ; return ( java.util.Objects.equals ( scope , other.scope ) ) && ( java.util.Objects.equals ( doneAt , other.doneAt ) ) ; }
Source:
public void testValues ( ) { java.util.List < java.lang.String > comps = java.util.Arrays.asList ( comp.getCompletion ( "L" ) ) ; org.junit.Assert.assertTrue ( "luke" , comps.contains ( "luke" ) ) ; org.junit.Assert.assertTrue ( "leia" , comps.contains ( "leia" ) ) ; org.junit.Assert.assertTrue ( ( ( comp.getCompletion ( "Z" ) . length ) == 0 ) ) ; }

Target:
public void testValues ( ) { java.util.List < java.lang.String > comps = java.util.Arrays.asList ( comp.getCompletion ( "L" ) ) ; org.junit.Assert.assertTrue ( "luke" , comps.contains ( "luke" ) ) ; org.junit.Assert.assertTrue ( "leia" , comps.contains ( "leia" ) ) ; org.junit.Assert.assertEquals ( 0 , comp.getCompletion ( "Z" ) . length ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > filteredClusters = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.filterByArchitecture ( clusters , vm.getClusterArch ( ) ) ; model.setDataCentersAndClusters ( model , dataCenters , filteredClusters , vm.getVdsGroupId ( ) ) ; initTemplate ( ) ; initCdImage ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > filteredClusters = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . filterByArchitecture ( clusters , vm.getClusterArch ( ) ) ; model.setDataCentersAndClusters ( model , dataCenters , filteredClusters , vm.getVdsGroupId ( ) ) ; initTemplate ( ) ; initCdImage ( ) ; }
Source:
private void gatherNonRunningVms ( java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.VM > dbVms ) { for ( org.ovirt.engine.core.common.businessentities.VM dbVm : dbVms.values ( ) ) { if ( ! ( vdsmVms.containsKey ( dbVm.getId ( ) ) ) ) { changedVms.add ( new org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData > ( dbVm , null ) ) ; } } }

Target:
private void gatherNonRunningVms ( java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.VM > dbVms ) { for ( org.ovirt.engine.core.common.businessentities.VM dbVm : dbVms.values ( ) ) { if ( ! ( vdsmVms.containsKey ( dbVm.getId ( ) ) ) ) { changedVms.add ( new org.ovirt.engine.core.common.utils.Pair ( dbVm , null ) ) ; } } }
Source:
public void validateEnoughSpace ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.storage.disk.MoveOrCopyDiskCommandTest.mockStorageDomainValidator ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }

Target:
public void validateEnoughSpace ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }
Source:
protected void selectedItemPropertyChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs e ) { super . selectedItemPropertyChanged ( sender , e ) ; if ( e.PropertyName.equals ( "status" ) ) { updateActionAvailability ( ) ; } else if ( e.PropertyName.equals ( "display_type" ) ) { updateConsoleModels ( ) ; } }

Target:
protected void selectedItemPropertyChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs e ) { super . selectedItemPropertyChanged ( sender , e ) ; if ( e.PropertyName.equals ( "status" ) ) { updateActionAvailability ( ) ; } }
Source:
private void addSoundDeviceToVm ( org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.core.compat.Guid deviceId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; java.util.Map < java.lang.String , java.lang.Object > specParams = new java.util.HashMap < > ( ) ; org.ovirt.engine.core.common.businessentities.VmDevice sound = new org.ovirt.engine.core.common.businessentities.VmDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( deviceId , vm.getId ( ) ) , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.SOUND , "" , null , 0 , specParams , true , true , true , null , null , null , null ) ; vm.getManagedVmDeviceMap ( ) . put ( deviceId , sound ) ; }

Target:
private void addSoundDeviceToVm ( org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.core.compat.Guid deviceId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; java.util.Map < java.lang.String , java.lang.Object > specParams = new java.util.HashMap < > ( ) ; org.ovirt.engine.core.common.businessentities.VmDevice sound = new org.ovirt.engine.core.common.businessentities.VmDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( deviceId , vm.getId ( ) ) , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.SOUND , "" , null , specParams , true , true , true , null , null , null , null ) ; vm.getManagedVmDeviceMap ( ) . put ( deviceId , sound ) ; }
Source:
private void onSave ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.models.profiles.ProfileBaseModel.getProgress ( ) ) != null ) { return ; } if ( ! ( validate ( ) ) ) { return ; } flush ( ) ; org.ovirt.engine.ui.uicommonweb.models.profiles.ProfileBaseModel.startProgress ( null ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( vdcActionType , getParameters ( ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { stopProgress ( ) ; cancel ( ) ; } } , this ) ; }

Target:
private void onSave ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.models.profiles.ProfileBaseModel.getProgress ( ) ) != null ) { return ; } if ( ! ( validate ( ) ) ) { return ; } flush ( ) ; org.ovirt.engine.ui.uicommonweb.models.profiles.ProfileBaseModel.startProgress ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( vdcActionType , getParameters ( ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { stopProgress ( ) ; cancel ( ) ; } } , this ) ; }
Source:
public static org.ovirt.engine.core.extensions.mgr.Configuration loadFile ( java.io.File file ) throws java.io.IOException { java.util.Properties properties = new java.util.Properties ( ) ; java.io.InputStream in = null ; try { in = new java.io.FileInputStream ( file ) ; properties.load ( in ) ; } finally { if ( in != null ) { in.close ( ) ; } } return new org.ovirt.engine.core.extensions.mgr.Configuration.Root ( file , properties ) ; }

Target:
public static org.ovirt.engine.core.extensions.mgr.Configuration loadFile ( java.io.File file ) throws java.io.IOException { java.util.Properties properties = new java.util.Properties ( ) ; try ( java.io.InputStream in = new java.io.FileInputStream ( file ) ) { properties.load ( in ) ; } return new org.ovirt.engine.core.extensions.mgr.Configuration.Root ( file , properties ) ; }
Source:
private void mockVmWithDisk ( org.ovirt.engine.core.compat.Guid storageId ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; image.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( storageId ) ) ) ; mockVm ( ) . getDiskMap ( ) . put ( image.getId ( ) , image ) ; }

Target:
private void mockVmWithDisk ( org.ovirt.engine.core.compat.Guid storageId ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; image.setStorageIds ( new java.util.ArrayList ( java.util.Arrays.asList ( storageId ) ) ) ; mockVm ( ) . getDiskMap ( ) . put ( image.getId ( ) , image ) ; }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj.getClass ( ) ) ) { return false ; } org.ovirt.engine.core.common.businessentities.VmDeviceId other = ( ( org.ovirt.engine.core.common.businessentities.VmDeviceId ) ( obj ) ) ; return ( java.util.Objects.equals ( deviceId , other.deviceId ) ) && ( java.util.Objects.equals ( vmId , other.vmId ) ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.VmDeviceId ) ) { return false ; } org.ovirt.engine.core.common.businessentities.VmDeviceId other = ( ( org.ovirt.engine.core.common.businessentities.VmDeviceId ) ( obj ) ) ; return ( java.util.Objects.equals ( deviceId , other.deviceId ) ) && ( java.util.Objects.equals ( vmId , other.vmId ) ) ; }
Source:
private void mockBackend ( boolean succeeded , org.ovirt.engine.core.common.errors.EngineError errorCode ) { org.mockito.Mockito.doReturn ( backend ) . when ( cmd ) . getBackend ( ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; vdsReturnValue.setSucceeded ( succeeded ) ; if ( ! succeeded ) { vdsReturnValue.setVdsError ( new org.ovirt.engine.core.common.errors.VDSError ( errorCode , "" ) ) ; } org.mockito.Mockito.when ( vdsBrokerFrontend.runVdsCommand ( org.mockito.ArgumentMatchers.eq ( VDSCommandType.RemoveGlusterHook ) , org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( vdsReturnValue ) ; }

Target:
private void mockBackend ( boolean succeeded , org.ovirt.engine.core.common.errors.EngineError errorCode ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; vdsReturnValue.setSucceeded ( succeeded ) ; if ( ! succeeded ) { vdsReturnValue.setVdsError ( new org.ovirt.engine.core.common.errors.VDSError ( errorCode , "" ) ) ; } org.mockito.Mockito.when ( vdsBrokerFrontend.runVdsCommand ( org.mockito.ArgumentMatchers.eq ( VDSCommandType.RemoveGlusterHook ) , org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( vdsReturnValue ) ; }
Source:
private org.ovirt.engine.core.bll.UpgradeOvirtNodeInternalCommand < org.ovirt.engine.core.common.action.InstallVdsParameters > createCommand ( org.ovirt.engine.core.common.action.InstallVdsParameters params ) { org.ovirt.engine.core.bll.UpgradeOvirtNodeInternalCommand < org.ovirt.engine.core.common.action.InstallVdsParameters > command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.UpgradeOvirtNodeInternalCommand < org.ovirt.engine.core.common.action.InstallVdsParameters > ( params ) ) ; org.mockito.Mockito.doReturn ( vdsDAO ) . when ( command ) . getVdsDAO ( ) ; return command ; }

Target:
private org.ovirt.engine.core.bll.UpgradeOvirtNodeInternalCommand < org.ovirt.engine.core.common.action.InstallVdsParameters > createCommand ( org.ovirt.engine.core.common.action.InstallVdsParameters params ) { org.ovirt.engine.core.bll.UpgradeOvirtNodeInternalCommand < org.ovirt.engine.core.common.action.InstallVdsParameters > command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.UpgradeOvirtNodeInternalCommand < org.ovirt.engine.core.common.action.InstallVdsParameters > ( params , null ) ) ; org.mockito.Mockito.doReturn ( vdsDAO ) . when ( command ) . getVdsDAO ( ) ; return command ; }
Source:
private void createStorageDomain ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus status ) { org.ovirt.engine.core.common.businessentities.storage_domains domain = new org.ovirt.engine.core.common.businessentities.storage_domains ( ) ; domain.setstatus ( status ) ; domain.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.mockito.Mockito.when ( storageDomainDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( domain ) ; org.mockito.Mockito.when ( storageDomainDAO.getForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( domain ) ; }

Target:
private void createStorageDomain ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus status ) { org.ovirt.engine.core.common.businessentities.StorageDomain domain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; domain.setstatus ( status ) ; domain.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.mockito.Mockito.when ( storageDomainDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( domain ) ; org.mockito.Mockito.when ( storageDomainDAO.getForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( domain ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.VmPool get ( org.ovirt.engine.core.compat.NGuid id , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "vm_pool_id" , id ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) ; return getCallsHandler ( ) . executeRead ( "GetVm_poolsByvm_pool_id" , org.ovirt.engine.core.dao.VmPoolDAODbFacadeImpl.VmPoolFullRowMapper.instance , parameterSource ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.VmPool get ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "vm_pool_id" , id ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) ; return getCallsHandler ( ) . executeRead ( "GetVm_poolsByvm_pool_id" , org.ovirt.engine.core.dao.VmPoolDAODbFacadeImpl.VmPoolFullRowMapper.instance , parameterSource ) ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , true ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , true ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void testQueryWithFilter ( ) throws java.lang.Exception { java.util.List < java.lang.String > filterValue = new java.util.ArrayList < > ( ) ; filterValue.add ( "true" ) ; org.mockito.Mockito.reset ( httpHeaders ) ; org.mockito.Mockito.when ( httpHeaders.getRequestHeader ( org.ovirt.engine.api.restapi.resource.USER_FILTER_HEADER ) ) . thenReturn ( filterValue ) ; setUpEntityQueryExpectations ( 1 ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; java.util.List < org.ovirt.engine.api.model.Network > networks = getCollection ( ) ; java.util.Collections.sort ( networks , java.util.Comparator.comparing ( Network :: getId ) ) ; verifyCollection ( networks ) ; }

Target:
public void testQueryWithFilter ( ) throws java.lang.Exception { java.util.List < java.lang.String > filterValue = new java.util.ArrayList < > ( ) ; filterValue.add ( "true" ) ; org.mockito.Mockito.reset ( httpHeaders ) ; org.mockito.Mockito.when ( httpHeaders.getRequestHeader ( org.ovirt.engine.api.restapi.resource.USER_FILTER_HEADER ) ) . thenReturn ( filterValue ) ; setUpEntityQueryExpectations ( 1 ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; java.util.List < org.ovirt.engine.api.model.Network > networks = getCollection ( ) ; networks.sort ( java.util.Comparator.comparing ( Network :: getId ) ) ; verifyCollection ( networks ) ; }
Source:
private org.ovirt.engine.core.common.vdscommands.VDSReturnValue mergeSnapshots ( org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.vdscommands.MergeSnapshotsVDSCommandParameters params = new org.ovirt.engine.core.common.vdscommands.MergeSnapshotsVDSCommandParameters ( storagePoolId , storageDomainId , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskCommand.getVmId ( ) , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskCommand.getDiskImage ( ) . getId ( ) , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskCommand.getDiskImage ( ) . getImageId ( ) , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskCommand.getDestinationDiskImage ( ) . getImageId ( ) , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskCommand.getDiskImage ( ) . isWipeAfterDelete ( ) ) ; return runVdsCommand ( VDSCommandType.MergeSnapshots , params ) ; }

Target:
protected org.ovirt.engine.core.common.vdscommands.VDSReturnValue mergeSnapshots ( org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.vdscommands.MergeSnapshotsVDSCommandParameters params = new org.ovirt.engine.core.common.vdscommands.MergeSnapshotsVDSCommandParameters ( storagePoolId , storageDomainId , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskCommand.getVmId ( ) , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskCommand.getDiskImage ( ) . getId ( ) , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskCommand.getDiskImage ( ) . getImageId ( ) , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskCommand.getDestinationDiskImage ( ) . getImageId ( ) , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskCommand.getDiskImage ( ) . isWipeAfterDelete ( ) ) ; return runVdsCommand ( VDSCommandType.MergeSnapshots , params ) ; }
Source:
private void prepareMocks ( org.ovirt.engine.core.bll.gluster.ManageGlusterServiceCommand command ) { org.mockito.Mockito.doReturn ( serviceDao ) . when ( command ) . getGlusterServiceDao ( ) ; org.mockito.Mockito.doReturn ( glusterUtils ) . when ( command ) . getGlusterUtils ( ) ; org.mockito.Mockito.doReturn ( getUpServers ( ) ) . when ( glusterUtils ) . getAllUpServers ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; }

Target:
private void prepareMocks ( org.ovirt.engine.core.bll.gluster.ManageGlusterServiceCommand command ) { org.mockito.Mockito.doReturn ( glusterUtils ) . when ( command ) . getGlusterUtils ( ) ; org.mockito.Mockito.doReturn ( getUpServers ( ) ) . when ( glusterUtils ) . getAllUpServers ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; }
Source:
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 ) ; }

Target:
protected void endWithFailure ( ) { super . endActionOnDisks ( ) ; removeVmRelatedEntitiesFromDb ( ) ; org.ovirt.engine.core.bll.AddVmCommand.setSucceeded ( true ) ; }
Source:
public void disableGlusterWhenVolumesExist ( ) { createCommandWithVirtEnabled ( ) ; org.mockito.Mockito.when ( clusterDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createClusterWithNoCpuName ( ) ) ; org.mockito.Mockito.when ( clusterDao.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createClusterWithNoCpuName ( ) ) ; cpuExists ( ) ; cpuFlagsNotMissing ( ) ; allQueriesForVms ( ) ; clusterHasGlusterVolumes ( ) ; validateFailedWithReason ( EngineMessage.CLUSTER_CANNOT_DISABLE_GLUSTER_WHEN_CLUSTER_CONTAINS_VOLUMES ) ; }

Target:
public void disableGlusterWhenVolumesExist ( ) { createCommandWithVirtEnabled ( ) ; org.mockito.Mockito.when ( clusterDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createClusterWithNoCpuName ( ) ) ; cpuExists ( ) ; cpuFlagsNotMissing ( ) ; allQueriesForVms ( ) ; clusterHasGlusterVolumes ( ) ; validateFailedWithReason ( EngineMessage.CLUSTER_CANNOT_DISABLE_GLUSTER_WHEN_CLUSTER_CONTAINS_VOLUMES ) ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel clusterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( returnValue ) ) ; clusterGuideModel.allHosts = hosts ; clusterGuideModel.UpdateOptionsNonLocalFS ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel clusterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( returnValue ) ) ; clusterGuideModel.allHosts = hosts ; clusterGuideModel.UpdateOptionsNonLocalFS ( ) ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmSnapshotListModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmSnapshotListModel ) ( target ) ) ; if ( returnValue != null ) { model.setCustomPropertiesKeysList ( ( ( java.util.HashMap < org.ovirt.engine.core.compat.Version , java.util.ArrayList < java.lang.String > > ) ( returnValue ) ) ) ; } }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmSnapshotListModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmSnapshotListModel ) ( target ) ) ; if ( returnValue != null ) { model.setCustomPropertiesKeysList ( ( ( java.util.HashMap < org.ovirt.engine.core.compat.Version , java.util.ArrayList < java.lang.String > > ) ( returnValue ) ) ) ; } }