auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public java.lang.Object runInTransaction ( ) { final org.ovirt.engine.core.common.businessentities.profiles.DiskProfile diskProfile = org.ovirt.engine.core.bll.profiles.DiskProfileHelper.createDiskProfile ( getStorageDomain ( ) . getId ( ) , getStorageDomainName ( ) ) ; org.ovirt.engine.core.common.action.DiskProfileParameters diskProfileParameters = new org.ovirt.engine.core.common.action.DiskProfileParameters ( diskProfile , true ) ; runInternalAction ( VdcActionType.AddDiskProfile , diskProfileParameters ) ; getCompensationContext ( ) . snapshotNewEntity ( diskProfile ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Object runInTransaction ( ) { final org.ovirt.engine.core.common.businessentities.profiles.DiskProfile diskProfile = diskProfileHelper.createDiskProfile ( getStorageDomain ( ) . getId ( ) , getStorageDomainName ( ) ) ; org.ovirt.engine.core.common.action.DiskProfileParameters diskProfileParameters = new org.ovirt.engine.core.common.action.DiskProfileParameters ( diskProfile , true ) ; runInternalAction ( VdcActionType.AddDiskProfile , diskProfileParameters ) ; getCompensationContext ( ) . snapshotNewEntity ( diskProfile ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
private static void assertFullGetAllByVmResult ( java.util.List < org.ovirt.engine.core.common.businessentities.Snapshot > snapshots ) { org.junit.Assert.assertEquals ( "VM should have a snapshot" , 1 , snapshots.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot : snapshots ) { org.junit.Assert.assertFalse ( "Snapshot shouldn't have configuration available" , snapshot.isVmConfigurationAvailable ( ) ) ; org.junit.Assert.assertTrue ( "Snapshot should have no configuration" , org.apache.commons.lang.StringUtils.isEmpty ( snapshot.getVmConfiguration ( ) ) ) ; } }

Target:
private static void assertFullGetAllByVmResult ( java.util.List < org.ovirt.engine.core.common.businessentities.Snapshot > snapshots ) { org.junit.jupiter.api.Assertions.assertEquals ( 1 , snapshots.size ( ) , "VM should have a snapshot" ) ; for ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot : snapshots ) { org.junit.jupiter.api.Assertions.assertFalse ( snapshot.isVmConfigurationAvailable ( ) , "Snapshot shouldn't have configuration available" ) ; org.junit.jupiter.api.Assertions.assertTrue ( org.apache.commons.lang.StringUtils.isEmpty ( snapshot.getVmConfiguration ( ) ) , "Snapshot should have no configuration" ) ; } }
Source:
public java.lang.Integer runInTransaction ( ) { org.ovirt.engine.core.common.businessentities.AsyncTasks asyncTask = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDao ( ) . get ( taskId ) ; int retVal = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDao ( ) . remove ( taskId ) ; if ( ( asyncTask != null ) && ( ! ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( asyncTask.getCommandId ( ) ) ) ) ) { commandsCache.remove ( asyncTask.getCommandId ( ) ) ; } return retVal ; }

Target:
public void persistCommand ( org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity ) { commandsCache.put ( cmdEntity ) ; if ( cmdEntity.isCallBackEnabled ( ) ) { buildCmdHierarchy ( cmdEntity ) ; } }
Source:
private java.util.Map < java.lang.Class < ? > , java.lang.Object > getMap ( ) { if ( ( org.ovirt.engine.api.common.invocation.Current.currents.get ( ) ) == null ) { org.ovirt.engine.api.common.invocation.Current.currents.set ( new java.util.HashMap < java.lang.Class < ? > , java.lang.Object > ( ) { { put ( org.ovirt.engine.api.common.invocation.MetaData.class , new org.ovirt.engine.api.common.invocation.MetaData ( ) ) ; } } ) ; } return org.ovirt.engine.api.common.invocation.Current.currents.get ( ) ; }

Target:
public void setUser ( org.ovirt.engine.core.common.businessentities.aaa.DbUser user ) { this . user = user ; }
Source:
private void numaSupport ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.core.common.businessentities.VDS host = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( getSelectedItem ( ) ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts = getSelectedItems ( ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.numa.NumaSupportModel model = new org.ovirt.engine.ui.uicommonweb.models.hosts.numa.NumaSupportModel ( hosts , host , this ) ; setWindow ( model ) ; }

Target:
private void numaSupport ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel.getWindow ( ) ) != null ) { return ; } org.ovirt.engine.core.common.businessentities.VDS host = org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel.getSelectedItem ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts = org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel.getSelectedItems ( ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.numa.NumaSupportModel model = new org.ovirt.engine.ui.uicommonweb.models.hosts.numa.NumaSupportModel ( hosts , host , this ) ; setWindow ( model ) ; }
Source:
public void testGetAllForRoleAndAdElement ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Permissions > result = dao.getAllForRoleAndAdElement ( org.ovirt.engine.core.dao.PermissionDAOTest.ROLE_ID , org.ovirt.engine.core.dao.PermissionDAOTest.AD_ELEMENT_ID ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.Permissions permission : result ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.PermissionDAOTest.ROLE_ID , permission.getrole_id ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.PermissionDAOTest.AD_ELEMENT_ID , permission.getad_element_id ( ) ) ; } }

Target:
public void testGetAllForRoleAndAdElement ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Permission > result = dao.getAllForRoleAndAdElement ( org.ovirt.engine.core.dao.PermissionDAOTest.ROLE_ID , org.ovirt.engine.core.dao.PermissionDAOTest.AD_ELEMENT_ID ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.Permission permission : result ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.PermissionDAOTest.ROLE_ID , permission.getRoleId ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.PermissionDAOTest.AD_ELEMENT_ID , permission.getAdElementId ( ) ) ; } }
Source:
public static void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.StorageType storageType , java.lang.String path ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }

Target:
public static void getStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }
Source:
public java.lang.Void call ( ) throws java.lang.Exception { final java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > conns = org.ovirt.engine.core.bll.storage.ISCSIStorageHelper.updateIfaces ( connections , host.getId ( ) ) ; runVdsCommand ( VDSCommandType.ConnectStorageServer , new org.ovirt.engine.core.common.vdscommands.StorageServerConnectionManagementVDSParameters ( host.getId ( ) , org.ovirt.engine.core.compat.Guid.Empty , org.ovirt.engine.core.common.businessentities.StorageType.ISCSI , conns ) ) ; return null ; }

Target:
public java.lang.Void call ( ) throws java.lang.Exception { try { final java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > conns = org.ovirt.engine.core.bll.storage.ISCSIStorageHelper.updateIfaces ( connections , host.getId ( ) ) ; runVdsCommand ( VDSCommandType.ConnectStorageServer , new org.ovirt.engine.core.common.vdscommands.StorageServerConnectionManagementVDSParameters ( host.getId ( ) , org.ovirt.engine.core.compat.Guid.Empty , org.ovirt.engine.core.common.businessentities.StorageType.ISCSI , conns ) ) ; } catch ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { log.errorFormat ( "Could not connect Host {0} - {1} to Iscsi Storage Server. The exception is: {2}" , host.getName ( ) , host.getId ( ) , e ) ; } return null ; }
Source:
public void testUpdateCantDo ( ) { try { update ( false , false , 1 ) ; } catch ( javax.ws.rs.WebApplicationException e ) { org.junit.Assert.assertNotNull ( e.getResponse ( ) ) ; org.junit.Assert.assertEquals ( 400 , e.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testUpdateCantDo ( ) { try { update ( false , false , 1 ) ; } catch ( javax.ws.rs.WebApplicationException e ) { org.junit.jupiter.api.Assertions.assertNotNull ( e.getResponse ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 400 , e.getResponse ( ) . getStatus ( ) ) ; } }
Source:
protected org.ovirt.engine.ui.uicommonweb.UICommand resolveCommand ( ) { return getDetailModel ( ) . getSyncAllHostNetworksCommand ( ) ; }

Target:
public org.ovirt.engine.ui.common.widget.listgroup.PatternflyListViewItem < org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceLineModel > createListViewItem ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceLineModel selectedItem ) { if ( ! ( selectedItem.getIsBonded ( ) ) ) { return new org.ovirt.engine.ui.webadmin.widget.host.HostNetworkInterfaceListViewItem ( selectedItem.getInterfaces ( ) . get ( 0 ) . getName ( ) , selectedItem ) ; } else { return new org.ovirt.engine.ui.webadmin.widget.host.HostNetworkInterfaceBondedListViewItem ( selectedItem , currentMainModel ) ; } }
Source:
public org.ovirt.engine.core.bll.SPMAsyncTask concreteCreateTask ( org.ovirt.engine.core.compat.Guid taskId , org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters p = new org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters ( asyncTaskCreationInfo , getAsyncTask ( taskId , asyncTaskCreationInfo , parentCommand ) ) ; p.setEntityInfo ( getParameters ( ) . getEntityInfo ( ) ) ; return createTask ( internalGetTaskType ( ) , p ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.AsyncTasks getAsyncTask ( org.ovirt.engine.core.compat.Guid taskId , org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { return org.ovirt.engine.core.bll.tasks.TaskManagerUtil.getAsyncTask ( taskId , this , asyncTaskCreationInfo , parentCommand ) ; }
Source:
protected void setupForStorageTests ( ) { org.mockito.Mockito.doReturn ( multipleSdValidator ) . when ( command ) . getStorageDomainsValidator ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.ArgumentMatchers.anySetOf ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( multipleSdValidator ) . allDomainsWithinThresholds ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( multipleSdValidator ) . allDomainsHaveSpaceForNewDisks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; }

Target:
protected void setupForStorageTests ( ) { org.mockito.Mockito.doReturn ( multipleSdValidator ) . when ( command ) . getStorageDomainsValidator ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.ArgumentMatchers.anySet ( ) ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( multipleSdValidator ) . allDomainsWithinThresholds ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( multipleSdValidator ) . allDomainsHaveSpaceForNewDisks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; }
Source:
public boolean hasMethod ( org.ovirt.api.metamodel.concepts.Name name ) { for ( org.ovirt.api.metamodel.concepts.Method method : methods ) { if ( java.util.Objects.equals ( method.getName ( ) , name ) ) { return true ; } } if ( ( base ) != null ) { return base.hasMethod ( name ) ; } return false ; }

Target:
public java.util.stream.Stream < org.ovirt.api.metamodel.concepts.Constraint > constraints ( ) { java.util.stream.Stream < org.ovirt.api.metamodel.concepts.Constraint > result = declaredConstraints ( ) ; if ( ( base ) != null ) { result = java.util.stream.Stream.concat ( base.constraints ( ) , result ) ; } return result ; }
Source:
public void testEmpty ( ) { org.ovirt.engine.core.searchbackend.IConditionFieldAutoCompleter comp = new org.ovirt.engine.core.searchbackend.AdGroupConditionFieldAutoCompleter ( ) ; java.util.List < java.lang.String > comps = java.util.Arrays.asList ( comp.getCompletion ( "" ) ) ; org.junit.Assert.assertTrue ( "name" , comps.contains ( "name" ) ) ; org.junit.Assert.assertFalse ( "False" , comps.contains ( "False" ) ) ; }

Target:
public void testEmpty ( ) { org.ovirt.engine.core.searchbackend.IConditionFieldAutoCompleter comp = new org.ovirt.engine.core.searchbackend.AdGroupConditionFieldAutoCompleter ( ) ; java.util.List < java.lang.String > comps = java.util.Arrays.asList ( comp.getCompletion ( "" ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( comps.contains ( "name" ) , "name" ) ; org.junit.jupiter.api.Assertions.assertFalse ( comps.contains ( "False" ) , "False" ) ; }
Source:
public void postDataCenterWithClusterSelectedItemChanged ( ) { updateDefaultHost ( ) ; updateCustomPropertySheet ( ) ; updateNumOfSockets ( ) ; updateQuotaByCluster ( vm.getQuotaId ( ) , vm.getQuotaName ( ) ) ; updateCpuPinningVisibility ( ) ; updateMemoryBalloon ( ) ; updateCpuSharesAvailability ( ) ; updateNetworkInterfaces ( networkBehavior , networkInerfaces ) ; }

Target:
public void postDataCenterWithClusterSelectedItemChanged ( ) { updateDefaultHost ( ) ; updateCustomPropertySheet ( ) ; updateNumOfSockets ( ) ; updateQuotaByCluster ( vm.getQuotaId ( ) , vm.getQuotaName ( ) ) ; updateCpuPinningVisibility ( ) ; updateMemoryBalloon ( ) ; updateCpuSharesAvailability ( ) ; updateNetworkInterfaces ( networkBehavior , networkInerfaces ) ; updateVirtioScsiAvailability ( ) ; }
Source:
public void addUsbSlots ( org.ovirt.engine.core.compat.Guid vmId , int numberOfSlots ) { for ( int index = 1 ; index <= numberOfSlots ; index ++ ) { addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , vmId ) , VmDeviceGeneralType.REDIR , VmDeviceType.SPICEVMC , org.ovirt.engine.core.bll.utils.VmDeviceUtils.EMPTY_SPEC_PARAMS , true , false ) ; } }

Target:
public void addUsbSlots ( org.ovirt.engine.core.compat.Guid vmId , int numberOfSlots ) { for ( int index = 1 ; index <= numberOfSlots ; index ++ ) { addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , vmId ) , VmDeviceGeneralType.REDIR , VmDeviceType.SPICEVMC , java.util.Collections.emptyMap ( ) , true , false ) ; } }
Source:
protected void onInitAllDisks ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > disks ) { for ( org.ovirt.engine.core.common.businessentities.Disk disk : disks ) { if ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) { allDisks.add ( org.ovirt.engine.ui.uicommonweb.Linq.DiskToModel ( disk ) ) ; } } }

Target:
protected void onInitAllDisks ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > disks ) { for ( org.ovirt.engine.core.common.businessentities.Disk disk : disks ) { if ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) { allDisks.add ( org.ovirt.engine.ui.uicommonweb.Linq.diskToModel ( disk ) ) ; } } }
Source:
private static org.ovirt.engine.core.common.businessentities.VM createVM ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setName ( "test-vm" ) ; vm.setOrigin ( OriginType.OVIRT ) ; vm.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vm.setVmDescription ( "test-description" ) ; vm.getStaticData ( ) . setDomain ( "domain_name" ) ; vm.setTimeZone ( "Israel Standard Time" ) ; vm.setDbGeneration ( 2L ) ; org.ovirt.engine.core.utils.ovf.OvfManagerTest.initInterfaces ( vm ) ; return vm ; }

Target:
private static org.ovirt.engine.core.common.businessentities.VM createVM ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setName ( "test-vm" ) ; vm.setOrigin ( OriginType.OVIRT ) ; vm.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vm.setVmDescription ( "test-description" ) ; vm.getStaticData ( ) . setDomain ( "domain_name" ) ; vm.setTimeZone ( "Israel Standard Time" ) ; vm.setDbGeneration ( 2L ) ; vm.setSingleQxlPci ( false ) ; vm.setClusterArch ( ArchitectureType.x86_64 ) ; org.ovirt.engine.core.utils.ovf.OvfManagerTest.initInterfaces ( vm ) ; return vm ; }
Source:
private void setUpGetCertuficateExpectations ( int times ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVdsCertificateSubjectByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ i ] } , org.ovirt.engine.api.restapi.resource.BackendVmsResourceTest.CERTIFICATE ) ; } }

Target:
private void setUpGetCertuficateExpectations ( int times ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( QueryType.GetVdsCertificateSubjectByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ i ] } , org.ovirt.engine.api.restapi.resource.BackendVmsResourceTest.CERTIFICATE ) ; } }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > getLabeledNics ( org.ovirt.engine.core.common.businessentities.network.Network network ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkCluster > clusters = org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.SyncNetworkParametersBuilder.getNetworkClusterDao ( ) . getAllForNetwork ( network.getId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > labeledNics = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster networkCluster : clusters ) { labeledNics.addAll ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.SyncNetworkParametersBuilder.getDbFacade ( ) . getInterfaceDao ( ) . getAllInterfacesByLabelForCluster ( networkCluster.getClusterId ( ) , network.getLabel ( ) ) ) ; } return labeledNics ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > getLabeledNics ( org.ovirt.engine.core.common.businessentities.network.Network network ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkCluster > clusters = networkClusterDao.getAllForNetwork ( network.getId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > labeledNics = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster networkCluster : clusters ) { labeledNics.addAll ( interfaceDao.getAllInterfacesByLabelForCluster ( networkCluster.getClusterId ( ) , network.getLabel ( ) ) ) ; } return labeledNics ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { return java.util.Collections.singletonList ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( getParameters ( ) . getQuotaId ( ) , org.ovirt.engine.core.common.VdcObjectType.Quota , getActionType ( ) . getActionGroup ( ) ) ) ; }

Target:
protected void executeCommand ( ) { getQuotaDao ( ) . remove ( getParameters ( ) . getId ( ) ) ; getQuotaManager ( ) . removeQuotaFromCache ( getQuota ( ) . getStoragePoolId ( ) , getParameters ( ) . getId ( ) ) ; getReturnValue ( ) . setSucceeded ( true ) ; }
Source:
private boolean checkIfHostBecomeUp ( ) { org.ovirt.engine.core.vdsbroker.VdsManager vdsManager = getResourceManager ( ) . GetVdsManager ( org.ovirt.engine.core.bll.pm.SshSoftFencingCommand.getVdsId ( ) ) ; int sleepInterval = ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VdsRefreshRate ) ) * 1000 ; while ( vdsManager.isHostInGracePeriod ( true ) ) { if ( ( vdsManager.getCopyVds ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) { return true ; } org.ovirt.engine.core.utils.ThreadUtils.sleep ( sleepInterval ) ; } return false ; }

Target:
private boolean checkIfHostBecomeUp ( ) { org.ovirt.engine.core.vdsbroker.VdsManager vdsManager = getResourceManager ( ) . getVdsManager ( org.ovirt.engine.core.bll.pm.SshSoftFencingCommand.getVdsId ( ) ) ; int sleepInterval = ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VdsRefreshRate ) ) * 1000 ; while ( vdsManager.isHostInGracePeriod ( true ) ) { if ( ( vdsManager.getCopyVds ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) { return true ; } org.ovirt.engine.core.utils.ThreadUtils.sleep ( sleepInterval ) ; } return false ; }
Source:
public void subnetChanged ( ) { org.ovirt.engine.core.common.businessentities.Network net = createNetwork ( "net" ) ; mockExistingNetworks ( net ) ; org.ovirt.engine.core.common.businessentities.VdsNetworkInterface nic = createNic ( "nic0" , net.getName ( ) ) ; nic.setBootProtocol ( NetworkBootProtocol.StaticIp ) ; nic.setSubnet ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; mockExistingIfaces ( nic ) ; nic.setSubnet ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic ) ) ; validateAndAssertNetworkModified ( helper , net ) ; }

Target:
public void subnetChanged ( ) { org.ovirt.engine.core.common.businessentities.Network net = createNetwork ( "net" ) ; mockExistingNetworks ( net ) ; org.ovirt.engine.core.common.businessentities.VdsNetworkInterface nic = createNicSyncedWithNetwork ( "nic0" , net ) ; nic.setBootProtocol ( NetworkBootProtocol.StaticIp ) ; nic.setSubnet ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; mockExistingIfaces ( nic ) ; nic.setSubnet ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic ) ) ; validateAndAssertNetworkModified ( helper , net ) ; }
Source:
public void testReapingOnPutWithGC ( ) { setUpGCExpectations ( 5 ) ; populate ( 1 , 2 , 3 ) ; map.reapable ( "one" ) ; map.reapable ( "three" ) ; assertSizes ( 1 , 2 ) ; populate ( 4 ) ; assertSizes ( 2 , 1 ) ; org.junit.Assert.assertNull ( map.get ( "three" ) ) ; }

Target:
public void testReapingOnPutWithGC ( ) { setUpGCExpectations ( 5 ) ; populate ( 1 , 2 , 3 ) ; map.reapable ( "one" ) ; map.reapable ( "three" ) ; assertSizes ( 1 , 2 ) ; populate ( 4 ) ; assertSizes ( 2 , 1 ) ; org.junit.jupiter.api.Assertions.assertNull ( map.get ( "three" ) ) ; }
Source:
public void testGetNotFound2 ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( asList ( getEntity ( 2 ) ) ) ; try { resource.get ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound2 ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( asList ( getEntity ( 2 ) ) ) ; verifyNotFoundException ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , resource :: get ) ) ; }
Source:
private void verifyPowerManagement ( org.ovirt.engine.api.model.PowerManagement pm ) { assertNotNull ( pm ) ; assertEquals ( "foo" , pm.getType ( ) ) ; assertEquals ( 2 , pm.getOptions ( ) . getOptions ( ) . size ( ) ) ; verifyOption ( pm.getOptions ( ) . getOptions ( ) . get ( 0 ) , "one" , "int" ) ; verifyOption ( pm.getOptions ( ) . getOptions ( ) . get ( 1 ) , "two" , "bool" ) ; }

Target:
private void verifyPowerManagement ( org.ovirt.engine.api.model.Agent agent ) { assertNotNull ( agent ) ; assertEquals ( "foo" , agent.getType ( ) ) ; assertEquals ( 2 , agent.getOptions ( ) . getOptions ( ) . size ( ) ) ; verifyOption ( agent.getOptions ( ) . getOptions ( ) . get ( 0 ) , "one" , "int" ) ; verifyOption ( agent.getOptions ( ) . getOptions ( ) . get ( 1 ) , "two" , "bool" ) ; }
Source:
public static void GetHostById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.GetVdsByVdsIdParameters ( id ) , aQuery ) ; }

Target:
public static void GetHostListByDataCenter ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid spId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > Cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVdsByStoragePool , new org.ovirt.engine.core.common.queries.GetAllVdsByStoragePoolParameters ( spId ) , aQuery ) ; }
Source:
public void postUpdateNumOfSockets2 ( ) { java.lang.String version = getCompatibilityVersion ( ) . toString ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxNumOfCPUsPerSocket ( new org.ovirt.engine.ui.frontend.AsyncQuery ( getModel ( ) , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase.this ; behavior.maxCpusPerSocket = ( ( java.lang.Integer ) ( returnValue ) ) ; behavior.postUpdateNumOfSockets3 ( ) ; } } ) , version ) ; }

Target:
public void postUpdateNumOfSockets2 ( ) { java.lang.String version = getCompatibilityVersion ( ) . toString ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxNumOfCPUsPerSocket ( asyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < java.lang.Integer > ( ) { @ java.lang.Override public void onSuccess ( java.lang.Integer returnValue ) { maxCpusPerSocket = returnValue ; postUpdateNumOfSockets3 ( ) ; } } ) , version ) ; }
Source:
public static void closeContext ( org.ovirt.engine.core.utils.log.Log log , javax.naming.InitialContext ctx ) { try { if ( ctx != null ) { ctx.close ( ) ; } } catch ( javax.naming.NamingException e ) { log.error ( ( "Error closing Context" + ( e.getMessage ( ) ) ) ) ; log.debug ( "" , e ) ; } }

Target:
public static void closeContext ( org.slf4j.Logger log , javax.naming.InitialContext ctx ) { try { if ( ctx != null ) { ctx.close ( ) ; } } catch ( javax.naming.NamingException e ) { log.error ( "Error closing Context: {}" , e.getMessage ( ) ) ; log.debug ( "Exception" , e ) ; } }
Source:
public void testValidateInvalid ( ) { final java.util.List < java.lang.String > invalidMacs = java.util.Arrays.asList ( "mac1" , "mac2" ) ; org.mockito.Mockito.when ( mockProblematicVmMacsFinder.findProblematicMacs ( mockVM ) ) . thenReturn ( invalidMacs ) ; final org.ovirt.engine.core.bll.ValidationResult actual = underTest.validate ( mockVM ) ; org.junit.Assert.assertThat ( actual , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.Unassigned , org.ovirt.engine.core.utils.ReplacementUtils.getListVariableAssignmentString ( EngineMessage.Unassigned , invalidMacs ) ) ) ; }

Target:
public void testValidateInvalid ( ) { final java.util.List < java.lang.String > invalidMacs = java.util.Arrays.asList ( "mac1" , "mac2" ) ; org.mockito.Mockito.when ( mockProblematicVmMacsFinder.findProblematicMacs ( mockVM ) ) . thenReturn ( invalidMacs ) ; final org.ovirt.engine.core.bll.ValidationResult actual = underTest.validate ( mockVM ) ; org.hamcrest.MatcherAssert.assertThat ( actual , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.Unassigned , org.ovirt.engine.core.utils.ReplacementUtils.getListVariableAssignmentString ( EngineMessage.Unassigned , invalidMacs ) ) ) ; }
Source:
public void unsyncedNetworkModified ( ) { org.ovirt.engine.core.common.businessentities.Network net = createNetwork ( "net" ) ; org.ovirt.engine.core.common.businessentities.VdsNetworkInterface nic = createNicSyncedWithNetwork ( "nic0" , net ) ; nic.setBridged ( ( ! ( net.isVmNetwork ( ) ) ) ) ; nic.setBootProtocol ( NetworkBootProtocol.None ) ; mockExistingNetworks ( net ) ; mockExistingIfaces ( nic ) ; nic.setBootProtocol ( NetworkBootProtocol.Dhcp ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORK_NOT_IN_SYNC ) ; }

Target:
public void unsyncedNetworkModified ( ) { org.ovirt.engine.core.common.businessentities.Network net = createNetwork ( "net" ) ; org.ovirt.engine.core.common.businessentities.VdsNetworkInterface nic = createNicSyncedWithNetwork ( "nic0" , net ) ; nic.setBridged ( ( ! ( net.isVmNetwork ( ) ) ) ) ; nic.setBootProtocol ( NetworkBootProtocol.None ) ; mockExistingNetworks ( net ) ; mockExistingIfaces ( nic ) ; nic.setBootProtocol ( NetworkBootProtocol.Dhcp ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORKS_NOT_IN_SYNC ) ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterEventListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand.equals ( getModel ( ) . getDetailsCommand ( ) ) ) { return eventPopupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterIscsiBondListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( ( lastExecutedCommand == ( getModel ( ) . getAddCommand ( ) ) ) || ( lastExecutedCommand == ( getModel ( ) . getEditCommand ( ) ) ) ) { return iscsiBondPopupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }
Source:
public org.ovirt.engine.api.model.Hooks list ( ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.HashMap < java.lang.String , java.util.HashMap < java.lang.String , java.util.HashMap < java.lang.String , java.lang.String > > > hooksMap = getEntity ( java.util.HashMap.class , VdcQueryType.GetVdsHooksById2 , new org.ovirt.engine.core.common.queries.GetVdsHooksByIdParameters ( asGuid ( hostId ) ) , null ) ; return mapCollection ( hooksMap ) ; }

Target:
public org.ovirt.engine.api.model.Hooks list ( ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.HashMap < java.lang.String , java.util.HashMap < java.lang.String , java.util.HashMap < java.lang.String , java.lang.String > > > hooksMap = getEntity ( java.util.HashMap.class , VdcQueryType.GetVdsHooksById , new org.ovirt.engine.core.common.queries.GetVdsHooksByIdParameters ( asGuid ( hostId ) ) , null ) ; return mapCollection ( hooksMap ) ; }
Source:
void updateActionButton ( org.ovirt.engine.ui.common.widget.action.ActionButton button , org.ovirt.engine.ui.common.widget.action.ActionButtonDefinition < T > buttonDef ) { button.asWidget ( ) . setVisible ( ( ( buttonDef.isAccessible ( ) ) && ( buttonDef.isVisible ( org.ovirt.engine.ui.common.widget.action.AbstractActionPanel.getSelectedItems ( ) ) ) ) ) ; button.setEnabled ( buttonDef.isEnabled ( org.ovirt.engine.ui.common.widget.action.AbstractActionPanel.getSelectedItems ( ) ) ) ; button.setTitle ( ( ( buttonDef.getCustomToolTip ( ) ) != null ? buttonDef.getCustomToolTip ( ) : buttonDef.getTitle ( ) ) ) ; }

Target:
void updateActionButton ( org.ovirt.engine.ui.common.widget.action.ActionButton button , org.ovirt.engine.ui.common.widget.action.ActionButtonDefinition < T > buttonDef ) { button.asWidget ( ) . setVisible ( ( ( buttonDef.isAccessible ( org.ovirt.engine.ui.common.widget.action.AbstractActionPanel.getSelectedItems ( ) ) ) && ( buttonDef.isVisible ( org.ovirt.engine.ui.common.widget.action.AbstractActionPanel.getSelectedItems ( ) ) ) ) ) ; button.setEnabled ( buttonDef.isEnabled ( org.ovirt.engine.ui.common.widget.action.AbstractActionPanel.getSelectedItems ( ) ) ) ; button.setTitle ( ( ( buttonDef.getButtonToolTip ( ) ) != null ? buttonDef.getButtonToolTip ( ) : buttonDef.getTitle ( ) ) ) ; }
Source:
public void testTryParse ( ) { org.ovirt.engine.core.compat.TimeSpan ref = org.ovirt.engine.core.compat.TimeSpan.tryParse ( "-1.02:03:04.05" ) ; org.junit.Assert.assertNotNull ( "A TimeSpan should be returned" , ref ) ; org.junit.Assert.assertEquals ( ( - 1 ) , ref.Days ) ; ref = org.ovirt.engine.core.compat.TimeSpan.tryParse ( "A Long Time" ) ; org.junit.Assert.assertNull ( "A TimeSpan should not be returned" , ref ) ; }

Target:
public void testTryParse ( ) { org.ovirt.engine.core.compat.TimeSpan ref = org.ovirt.engine.core.compat.TimeSpan.tryParse ( "-1.02:03:04.05" ) ; org.junit.jupiter.api.Assertions.assertNotNull ( ref , "A TimeSpan should be returned" ) ; org.junit.jupiter.api.Assertions.assertEquals ( ( - 1 ) , ref.Days ) ; ref = org.ovirt.engine.core.compat.TimeSpan.tryParse ( "A Long Time" ) ; org.junit.jupiter.api.Assertions.assertNull ( ref , "A TimeSpan should not be returned" ) ; }
Source:
public void canDoActionSucceedsOnDiskDomainCheckWhenStorageGuidInParamsMatches ( ) throws java.lang.Exception { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; initializeCommand ( storageId ) ; mockVmWithDisk ( storageId ) ; mockVmNetworks ( ) ; mockStorageDomain ( storageId ) ; mockStoragePoolIsoMap ( ) ; runAndAssertCanDoActionSuccess ( ) ; }

Target:
public void canDoActionThinProvisioningSpaceCheckFailsPct ( ) { final int availableSize = 9 ; final int usedSize = 191 ; org.ovirt.engine.core.compat.Guid sdid = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; initializeCommand ( sdid , VolumeType.Sparse ) ; mockVm ( ) ; org.ovirt.engine.core.common.businessentities.storage_domains domains = mockStorageDomain ( sdid , availableSize , usedSize ) ; mockStoragePoolIsoMap ( ) ; mockStorageDomainSpaceChecker ( domains , false ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW.toString ( ) ) ) ; }
Source:
private void edit ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.vms.VmInterfaceModel model = org.ovirt.engine.ui.uicommonweb.models.vms.EditVmInterfaceModel.createInstance ( getEntity ( ) . getStaticData ( ) , getEntity ( ) , getEntity ( ) . getVdsGroupCompatibilityVersion ( ) , ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( getItems ( ) ) ) , getSelectedItem ( ) , this ) ; setWindow ( model ) ; }

Target:
private void edit ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.vms.VmInterfaceModel model = org.ovirt.engine.ui.uicommonweb.models.vms.EditVmInterfaceModel.createInstance ( getEntity ( ) . getStaticData ( ) , getEntity ( ) , getEntity ( ) . getClusterCompatibilityVersion ( ) , ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( getItems ( ) ) ) , getSelectedItem ( ) , this ) ; setWindow ( model ) ; }
Source:
public void testSave ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkCluster > clustersFromDB = dbFacade.getNetworkClusterDao ( ) . getAllForCluster ( cluster ) ; org.ovirt.engine.core.common.businessentities.network.NetworkCluster clusterFromDB = clustersFromDB.get ( 0 ) ; org.junit.Assert.assertNotNull ( clusterFromDB ) ; new_net.setCluster ( clusterFromDB ) ; new_net.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; dao.save ( new_net ) ; org.ovirt.engine.core.common.businessentities.network.Network result = dao.getByName ( new_net.getName ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( new_net , result ) ; }

Target:
public void testSave ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkCluster > clustersFromDB = dbFacade.getNetworkClusterDao ( ) . getAllForCluster ( cluster ) ; org.ovirt.engine.core.common.businessentities.network.NetworkCluster clusterFromDB = clustersFromDB.get ( 0 ) ; org.junit.Assert.assertNotNull ( clusterFromDB ) ; new_net.setCluster ( clusterFromDB ) ; new_net.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; dao.save ( new_net ) ; org.ovirt.engine.core.common.businessentities.network.Network result = dao.getByName ( new_net.getName ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( new_net , result ) ; }
Source:
public void testMigrateWithClusterId ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.MigrateVm , org.ovirt.engine.core.common.action.MigrateVmParameters.class , new java.lang.String [ ] { "VmId" , "ForceMigrationForNonMigratableVm" , "TargetVdsGroupId" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.FALSE , GUIDS [ 1 ] } ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster ( ) ; cluster.setId ( GUIDS [ 1 ] . toString ( ) ) ; action.setCluster ( cluster ) ; verifyActionResponse ( resource.migrate ( action ) ) ; }

Target:
public void testMigrateWithClusterId ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.MigrateVm , org.ovirt.engine.core.common.action.MigrateVmParameters.class , new java.lang.String [ ] { "VmId" , "ForceMigrationForNonMigratableVm" , "TargetClusterId" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.FALSE , GUIDS [ 1 ] } ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setId ( GUIDS [ 1 ] . toString ( ) ) ; action.setCluster ( cluster ) ; verifyActionResponse ( resource.migrate ( action ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepResume ( java.lang.String volumeName , java.lang.String slaveHostName , java.lang.String slaveVolumeName , boolean force ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeGeoRepResume ( volumeName , slaveHostName , slaveVolumeName , force ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionResume ( java.lang.String volumeName , java.lang.String slaveHostName , java.lang.String slaveVolumeName , boolean force ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeGeoRepSessionResume ( volumeName , slaveHostName , slaveVolumeName , force ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
private boolean validateAttachment ( ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidator validator = new org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidator ( getNetworkCluster ( ) , org.ovirt.engine.core.bll.network.cluster.AttachNetworkToVdsGroupCommand.getVdsGroup ( ) . getcompatibility_version ( ) ) ; return ( ( ( ! ( org.ovirt.engine.core.utils.NetworkUtils.isManagementNetwork ( getNetwork ( ) ) ) ) || ( validate ( validator.managementNetworkAttachment ( getNetworkName ( ) ) ) ) ) && ( validate ( validator.migrationPropertySupported ( getNetworkName ( ) ) ) ) ) && ( ( ! ( getPersistedNetwork ( ) . isExternal ( ) ) ) || ( validateExternalNetwork ( validator ) ) ) ; }

Target:
private boolean changesAreClusterCompatible ( ) { if ( ( org.ovirt.engine.core.bll.network.cluster.AttachNetworkToVdsGroupCommand.getParameters ( ) . getNetwork ( ) . isVmNetwork ( ) ) == false ) { if ( ! ( org.ovirt.engine.core.common.FeatureSupported.nonVmNetwork ( org.ovirt.engine.core.bll.network.cluster.AttachNetworkToVdsGroupCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.NON_VM_NETWORK_NOT_SUPPORTED_FOR_POOL_LEVEL ) ; return false ; } } return true ; }
Source:
private void updateSpiceUsbAutoShare ( final org.ovirt.engine.ui.uicommonweb.models.vms.ISpice spice ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getSpiceUsbAutoShare ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { spice.getOptions ( ) . setUsbAutoShare ( ( ( java.lang.Boolean ) ( returnValue ) ) ) ; } } ) ) ; }

Target:
private void updateSpiceUsbAutoShare ( final org.ovirt.engine.ui.uicommonweb.models.vms.ISpice spice ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getSpiceUsbAutoShare ( new org.ovirt.engine.ui.frontend.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < java.lang.Boolean > ( ) { @ java.lang.Override public void onSuccess ( java.lang.Boolean returnValue ) { spice.getOptions ( ) . setUsbAutoShare ( returnValue ) ; } } ) ) ; }
Source:
public void testUpdateGlusterServerHookStatus ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook serverhookExisting = dao.getGlusterServerHook ( FixturesTool.HOOK_ID , org.ovirt.engine.core.dao.gluster.GlusterHooksDaoTest.SERVER_ID ) ; org.junit.Assert.assertEquals ( GlusterHookStatus.ENABLED , serverhookExisting.getStatus ( ) ) ; dao.updateGlusterServerHookStatus ( FixturesTool.HOOK_ID , org.ovirt.engine.core.dao.gluster.GlusterHooksDaoTest.SERVER_ID , GlusterHookStatus.DISABLED ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook serverhookUpdated = dao.getGlusterServerHook ( FixturesTool.HOOK_ID , org.ovirt.engine.core.dao.gluster.GlusterHooksDaoTest.SERVER_ID ) ; org.junit.Assert.assertNotNull ( serverhookUpdated ) ; org.junit.Assert.assertEquals ( GlusterHookStatus.DISABLED , serverhookUpdated.getStatus ( ) ) ; }

Target:
public void testUpdateGlusterServerHookStatus ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook serverhookExisting = dao.getGlusterServerHook ( FixturesTool.HOOK_ID , FixturesTool.VDS_GLUSTER_SERVER2 ) ; org.junit.Assert.assertEquals ( GlusterHookStatus.ENABLED , serverhookExisting.getStatus ( ) ) ; dao.updateGlusterServerHookStatus ( FixturesTool.HOOK_ID , FixturesTool.VDS_GLUSTER_SERVER2 , GlusterHookStatus.DISABLED ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook serverhookUpdated = dao.getGlusterServerHook ( FixturesTool.HOOK_ID , FixturesTool.VDS_GLUSTER_SERVER2 ) ; org.junit.Assert.assertNotNull ( serverhookUpdated ) ; org.junit.Assert.assertEquals ( GlusterHookStatus.DISABLED , serverhookUpdated.getStatus ( ) ) ; }
Source:
public static void getRoleList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }

Target:
public void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }